Google plus subscribers in text form

How to get Google plus subscribers in text format? JSON or XML https://developers.google.com/+/api/latest/people/get does not have a subscriber field key.

+4
source share
5 answers

There is currently no way to get followers (or any circle information) from Google+ via the API.

+4
source

Actually there is: 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 

using Ruby.

+2
source

in 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']; 
+2
source

You can use the API key, make sure that Google plus the visibility of subscribers should be publicly available.

try the script: 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); } }); 
+2
source

You can get all your circles using the People.list method, for example:

 ... Plus.People.List listPeople = plus.people().list("me", "visible"); listPeople.setMaxResults(5L); PeopleFeed peopleFeed = listPeople.execute(); List<Person> people = peopleFeed.getItems(); ... 

Try an example in the API

0
source

Source: https://habr.com/ru/post/1390327/


All Articles