Answer the question
In order to leave comments, you need to log in
How to subscribe to like a photo on VKontakte and find out as soon as someone likes this photo?
How to subscribe to like a photo on VKontakte and find out as soon as someone likes this photo?
I created an application and there is a "Like" button (or another option - I'll just post a photo on VKontakte) and I need my server to immediately know that the photo was liked.
You can get likes https://vk.com/dev/likes.getList , but I want them to update themselves like VKontakte.
<script type="text/javascript" src="openapi.js"></script>
<div id="vk_like"></div>
<script type="text/javascript">
VK.init({apiId: 5309489});
VK.Widgets.Like("vk_like", {type: "button"},55);
VK.Observer.subscribe("widgets.like.liked", function f()
{
alert ("Thank you for your like.");
});
</script> //этот код не работает в режиме реального времени
Answer the question
In order to leave comments, you need to log in
Subscribe to events of their api
https://vk.com/dev/openapi_observer
An example is just about likes
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question