A
A
AstonMartin2013-11-11 18:07:00
In contact with
AstonMartin, 2013-11-11 18:07:00

Get the number of likes on the pages of the site?

Good day!
Please tell me how to solve this problem. There is a site with a VKontakte "Like" button on the pages. It is necessary to make the block "Most popular on the site" with a list of articles sorted by likes.
From which side to approach the decision?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
H
hMartin, 2013-11-11
@AstonMartin

https://vk.com/dev/likes.getList
Example:

https://api.vk.com/method/likes.getList?type=sitepage&owner_id=2018480&page_url=http://lifehacker.ru/2013/11/11/kogda-pora-brosat-pit/&filter=likes

S
SerDIDG, 2013-11-11
@SerDIDG

They did it for themselves, something like this. But I think it's better through the API

$contents = file_get_contents('http://vk.com/share.php?act=count&index=1&url='.$url);
preg_match('/VK\.Share\.count\(1, ([0-9]+)\)/', $contents, $matches);
if(isset($matches[1])){
  $counters['vk'] = (int) $matches[1];
}

B
Badevlad, 2013-11-11
@Badevlad

Probably, you need to approach the solution from the VK API .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question