- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
$url = get_permalink();
$fb = file_get_contents( 'http://graph.facebook.com/?id=' . $url );
$tw = file_get_contents( 'https://cdn.api.twitter.com/1/urls/count.json?url=' . $url );
$pnt = file_get_contents( 'http://api.pinterest.com/v1/urls/count.json?callback%20&url=' . $url );
$lkd = file_get_contents( 'https://www.linkedin.com/countserv/count/share?url=' . $url . '&format=json' );
$vk = file_get_contents('https://vk.com/share.php?act=count&index=1&url='.$url);
preg_match("/, (.*?)\\);/", $vk, $vkp);
$mail = file_get_contents('http://connect.mail.ru/share_count?url_list='.$url);
$ok = file_get_contents('http://ok.ru/dk?st.cmd=extOneClickLike&uid=odklocs0&ref='.$url);
preg_match("/'.*','(.*?)','.*'/", $ok, $okp);
$rd = file_get_contents('https://www.reddit.com/api/info.json?url='.$url);
$plus = file_get_contents('https://plusone.google.com/u/0/_/+1/fastbutton?count=true&url='.$url);
preg_match("/aggregateCount.*?>(.*?)<.*?/", $plus, $pl);
$tumblr = file_get_contents('http://api.tumblr.com/v2/share/stats?url='.$url);
$shList = array(
'fb' => json_decode($fb)->shares,
'twitter' => json_decode($tw)->count,
'od' => $okp[1],
'pinterest' => json_decode(preg_replace( '/^receiveCount\((.*)\)$/', '\\1', $pnt ))->count,
'linkedin' => json_decode($lkd)->count,
'vk' => $vkp[1],
'reddit' => count(json_decode($rd)->data->children),
'gplus' => $pl[1],
'tumblr' => json_decode($tumblr)->response->note_count
);
Самописный подсчет количества расшариваний в соц сетях на PHP. Потом через JS раскидаем массив по блокам
inkanus-gray 19.09.2015 15:24 # 0
3_14dar 19.09.2015 15:55 # 0
guest 19.09.2015 21:25 # +4
3_14dar 19.09.2015 21:29 # −1
3_14dar 20.09.2015 22:06 # +2
напитон безалкогольный среднегазированный "хрустальный колодец со вкусом лимона"