|
Facebook*: |
|
https://api.facebook.com/method/links.getStats?urls=%%URL%%&format=json |
|
+ works, returns shares, likes, comments and total |
|
|
|
Twitter: |
|
http://cdn.api.twitter.com/1/urls/count.json?url=URL |
|
+ source http://stackoverflow.com/questions/4775578/is-there-a-way-to-get-the-twitter-share-count-for-a-specific-url |
|
|
|
Reddit: |
|
http://buttons.reddit.com/button_info.json?url=%%URL%% |
|
+ works |
|
|
|
LinkedIn: |
|
https://www.linkedin.com/countserv/count/share?url=https://www.facebook.com&format=json |
|
+ works |
|
|
|
Digg: |
|
http://widgets.digg.com/buttons/count?url=%%URL%% |
|
- NOT WORKING! |
|
|
|
Delicious: |
|
http://feeds.delicious.com/v2/json/urlinfo/data?url=%%URL%% |
|
+ works |
|
|
|
StumbleUpon: |
|
http://www.stumbleupon.com/services/1.01/badge.getinfo?url=http://www.treehugger.com/ |
|
+ works |
|
|
|
Pinterest: |
|
http://widgets.pinterest.com/v1/urls/count.json?source=6&url=%%URL%% |
|
+ works |
|
|
|
Vkontakte Shares: |
|
http://vk.com/share.php?act=count&url=%%URL%% |
|
+ works |
|
|
|
Vkontakte Likes: |
|
http://suvitruf.ru/2012/06/02/1255/ |
|
|
|
Odnoklassniki: |
|
http://www.odnoklassniki.ru/dk?st.cmd=extOneClickLike&uid=odklocs0&ref=%%URL%% |
|
+ works |
|
|
|
Мой Мир Mail.ru: |
|
http://connect.mail.ru/share_count?url_list=%%URL%% |
|
+ works |
|
|
|
Google+ counts are retrieved via a JSON-RPC POST call. |
|
POST URL: |
|
https://clients6.google.com/rpc?key=AIzaSyCKSbrvQasunBoV16zDH9R33D88CeLr9gQ |
|
POST Body: |
|
[{"method":"pos.plusones.get","id":"p","params":{"nolog":true,"id":"%%URL%%","source":"widget","userId":"@viewer","groupId":"@self"},"jsonrpc":"2.0","key":"p","apiVersion":"v1"}] |
|
|
|
or: |
|
https://plusone.google.com/u/0/_/+1/fastbutton?count=true&url=%%URL%% |
|
+ shows counter, you can parse html (div#aggregateCount) |
|
|
|
$google_request = file_get_contents('https://plusone.google.com/u/0/_/+1/fastbutton?count=true&url='.$url); |
|
$plusone_count = preg_replace('/(.*)<div id="aggregateCount" class="t1">(([0-9])*)<\/div>(.*)/is','$2',$google_request); |
|
|
|
Reading: |
|
http://www.tomanthony.co.uk/blog/google_plus_one_button_seo_count_api/ |
|
http://sergunik.name/?p=799 |
|
http://suvitruf.ru/2012/06/02/1255/ |
|
|
|
https://gist.github.com/eyecatchup/8495140 |
|
|
|
function GooglePlus($url) { |
|
|
|
$url = sprintf('https://plusone.google.com/u/0/_/+1/fastbutton?url=%s', urlencode($url)); |
|
preg_match_all('/{c: (.*?),/', file_get_contents($url), $match, PREG_SET_ORDER); |
|
return (1 === sizeof($match) && 2 === sizeof($match[0])) ? intval($match[0][1]) : 0; |
|
|
|
|
|
} |
|
|
|
Refference https://gist.github.com/jonathanmoore/2640302 |