E
E
Eugene Zhadko2018-06-17 14:09:08
API
Eugene Zhadko, 2018-06-17 14:09:08

How to track the repost of a vk open api website page?

Hello.
VKontakte has a wonderful "I like" widget , the events of which can be processed through open api .
This widget can also "track" the repost of a site page post. Unfortunately, I am unable to do this.
Below is the code from the documentation:

<script type="text/javascript" src="//vk.com/js/api/openapi.js?122"></script>

<script type="text/javascript">
  VK.init({apiId: 123456});
</script>
<div id="vk_like"></div>
<script type="text/javascript">
VK.Widgets.Like("vk_like", {type: "button"});
VK.Observer.subscribe("widgets.like.liked", function f()
{
alert ("Thank you for your like.");
});
</script>

After the person likes, an alert will appear with a message. How to do the same with repost?
If the person reposted, trigger an event.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2018-06-17
@sergiks

Need to listen to the eventwidgets.like.shared

VK.Observer.subscribe(
  "widgets.like.shared",
  function f() {
    alert ("Thank you for your SHARE.");
  }
);

See supported events .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question