Reputation: 492
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.
I'm looking for a method similar to the facebook graph and twitter api.
Is this possible?
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?
<?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'];
?>
Upvotes: 3
Views: 2002
Reputation: 6841
Edited to reflect updates to the Google+ APIs
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. 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.
Prior to February 26, 2013, the API provided no method for listing people related to a user.
Upvotes: 1