简体   繁体   English

谷歌加上关注者

[英]Get followers on google plus

I've been looking around for a way to retrieve "plusoners" or followers for a Google Plus page in plain text, but I cant find anything. 我一直在寻找一种方法来检索纯文本的Google Plus页面的“plusoners”或关注者,但我找不到任何东西。

I'm looking for a method similar to the facebook graph and twitter api. 我正在寻找类似于facebook图和twitter api的方法。

Is this possible? 这可能吗?

UPDATE UPDATE

I've found this script, but it is fetching the "plus ones" for a website. 我找到了这个脚本,但它正在为网站提供“加号”。 Is it possible to make this script print the number of followers for a google plus page instead? 是否可以使此脚本打印google plus页面的关注者数量?

<?php

 $url = "http://www.tomanthony.co.uk/";

 $ch = curl_init();  
 curl_setopt($ch, CURLOPT_URL, "https://clients6.google.com/rpc?key=******");
 curl_setopt($ch, CURLOPT_POST, 1);
 curl_setopt($ch, CURLOPT_POSTFIELDS, '[{"method":"pos.plusones.get","id":"p","params":{"nolog":true,"id":"' . $url . '","source":"widget","userId":"@viewer","groupId":"@self"},"jsonrpc":"2.0","key":"p","apiVersion":"v1"}]');
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));


 $curl_results = curl_exec ($ch);
 curl_close ($ch);

 $parsed_results = json_decode($curl_results, true);

 echo $parsed_results[0]['result']['metadata']['globalCounts']['count'];

?>

Edited to reflect updates to the Google+ APIs 已编辑以反映Google+ API的更新

If your app uses Google+ Sign-In or requests the https://www.googleapis.com/auth/plus.login scope, you can get a flat list of people that a person has in their circles. 如果您的应用使用Google+登录或请求https://www.googleapis.com/auth/plus.login范围,您可以获得一个人在其圈子中拥有的人员列表。 This isn't exactly what you're asking about though. 这不是你要问的问题。 Your request wants to get those people that follow the target individual, that still isn't possible, but the people.list might accomplish your goals. 您的请求希望让那些跟踪目标个人的人仍然无法做到,但是people.list可能会实现您的目标。

Prior to February 26, 2013 , the API provided no method for listing people related to a user. 2013年2月26日之前,API没有提供列出与用户相关的人员的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM