Domanda

Come arrivare Google Plus seguaci in testo normale? JSON o XML https://developers.google.com/+/api/latest/people/get non hai chiave seguaci campo.

È stato utile?

Soluzione

Al momento non v'è alcun modo per ottenere seguaci (o qualsiasi informazione cerchio) da Google+ tramite l'API.

Altri suggerimenti

You can do using API key, must sure Google plus followers visibility should be public

try on fiddle: 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);
    }
});

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.

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'];

You can retrieve all of 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 the example in the APIs Explorer

As of August 2018 the Google+ API endpoint https://www.googleapis.com/plus/v1/people/userId/people/collection is deprecated.

There is a new endpoint for getting all the contacts: https://people.googleapis.com/v1/people/me/connections. There is a metadata key in the response, and for Google+ contacts it will look somewhat like this:

  "metadata": {
    "sources": [
      {
        "updateTime": "2013-01-13T19:16:50.668Z", 
        "etag": "...", 
        "type": "CONTACT", 
        "id": "..."
      }, 
      {
        "etag": "...", 
        "type": "PROFILE", 
        "id": "...", 
        "profileMetadata": {
          "userTypes": [
            "GOOGLE_USER", 
            "GPLUS_USER"
          ], 
          "objectType": "PERSON"
        }
      }
    ], 
    "objectType": "PERSON"
  }

Note the "GPLUS_USER" part.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top