On the website there are 2 likes of buttons from Facebook and VKontakte, how to calculate their total number and display them in a separate value?

<div id="vk_like"><script type="text/javascript"> VK.Widgets.Like("vk_like", {type: "mini"}); </script></div> <div class="fb-like" data-href="/" data-layout="button_count" data action="like" data-show-faces="true" data-size="small" data-width="50" data-share="false"></div> 
  • Best use the API as advised by @ Yury-Bakharev. This is the best and right decision. You can get values ​​by crown at night and write yourself in the database. Or use the file_get_contents parse page and get the number of likes. - Makarenko_I_V

1 answer 1

I don’t know how to parse the page code, but you can use API VK or Facebook. (likes.getList - for example in VK and https://developers.facebook.com/docs/graph-api/reference/user/likes/ - Facebook)