Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

google plus one button statistics

I would like to know how to get the value for the +1 value((if there are 10 clicks +1 button, store 10 as a variable). This would be helpful for analysis purposes. I know the count parameter is only Boolean or plusone.state returns on/off but is there something like plusone.value? ( i tried it, it's undefined)

Thanks

like image 978
lolalola Avatar asked Dec 22 '22 09:12

lolalola


1 Answers

Download the following url: https://plusone.google.com/u/0/_/+1/fastbutton?count=true&url=URLENCODED_URI via your favorite automatic method (curl, wget, file_get_contents, etc...)

URLENCODED_URI is the site you which to know the number of +1's for, e.g. http://www.google.com

For example, fetch the URI https://plusone.google.com/u/0/_/%2B1/fastbutton?count=true&url=http://www.google.com/ and locate the first occurance of window.__SSR = {'c': 32414.0 ,'si'. Preferably use regexp for this, but I'll leave the implementation to you and your chosen programming language.

The float number following 'c' is the number of +1's the site have. For google.com this is 32.414. Don't worry about it being a float, it is allways an integer in float format, so you can safely convert it to an integer.

like image 80
Aron Cederholm Avatar answered Feb 20 '23 00:02

Aron Cederholm