2012-01-10 66 views

回答

4

目前還沒有辦法通過API來自Google+讓追隨者(或任何圈子的信息)。

+2

這不再是這種情況,請參閱https://developers.google.com/+/api/latest/people/list方法。 – paulmatthews86 2014-01-27 15:35:13

+0

@ paulmatthews86:該API調用可以返回我關注的人,而不是我的追隨者。 – BlaM 2015-08-03 11:55:14

2

其實有:http://www.emoticode.net/ruby/get-google-page-followers-count-with-google-api.html

require 'open-uri' 
require 'json' 

google_api_key = 'put your google api key here' 
page_id = '105672627985088123672' 

data = open("https://www.googleapis.com/plus/v1/people/#{page_id}?key=#{google_api_key}").read  
obj = JSON.parse(data) 

puts obj['plusOneCount'].to_i 

使用Ruby。

+0

你必須接受這個答案。 – dikirill 2014-01-22 22:38:44

+0

Link是突破:??'( – CarMoreno 2017-12-15 15:55:37

2
在PHP

// get api https://code.google.com/apis/console?hl=en#access 
$google_api_key = 'YOUR_API'; 
$page_id = 'YOUR_PAGE_ID'; 
$data = @file_get_contents("https://www.googleapis.com/plus/v1/people/$page_id?key=$google_api_key"); 
$data = json_decode($data, true); 
echo $data['plusOneCount']; 
+0

抱歉給這個帖子備份 - 你有什麼INSITE,這是否仍然有效 – 2014-11-07 15:40:05

+0

至於我可以告訴大家,不返回任何跟隨者(再) – BlaM 2015-08-03 11:59:01

+0

只是改變' echo $ data ['plusOneCount'];''echo $ data ['circledByCount'];' – techno 2017-11-09 20:36:47

0

您可以檢索全部採用People.list方法你的圈子,例如:

... 
Plus.People.List listPeople = plus.people().list("me", "visible"); 
listPeople.setMaxResults(5L); 

PeopleFeed peopleFeed = listPeople.execute(); 
List<Person> people = peopleFeed.getItems(); 
... 

Try the example in the APIs Explorer

2

了可以使用API​​密鑰,必須確保谷歌,加上追隨者的知名度應該是公開的

試穿小提琴:https://jsfiddle.net/himstar/j4932w0s/

var profileid = '100520061367519307358'; 
var apikey = 'AIzaSyAqlZ1MJSGXMSs8q5WbfvLpZTGJeHLVc2w'; 
var url = 'https://www.googleapis.com/plus/v1/people/' + profileid + '?key=' + apikey; 
$.ajax({ 
    type: "GET", 
    dataType: "json", 
    url: url, 
    success: function (data) { 
     var googlefollowcount = data.circledByCount; 
     $(".googlefollowercount").html(googlefollowcount); 
    } 
});