E
E
Evgeny Lisovsky2016-01-28 12:10:13
Classmates
Evgeny Lisovsky, 2016-01-28 12:10:13

How to correctly get the number of links shared in OK.ru?

I want to get the number of shares in OK through the rest api.
The way to get the counter from the button is not entirely correct, since it also shows classes, and I only need sharing (or at least an explicit separation of these values).
Judging by the documentation , you need to register the application. What if I don't have an app, but a website? I don’t take money from OK users, I’m not going to post on their behalf - only counters are needed.
Tell me please. Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
@
@GTimer, 2016-01-29
@multed

Unfortunately, at the moment it is not possible to get only a ball counter.
However, you can count the shares yourself, the button documentation ( https://apiok.ru/wiki/pages/viewpage.action?pageId...) describes how to connect a javascript listener to successful shares:

function listenForShare() {
    if (window.addEventListener) {
        window.addEventListener('message', onShare, false);
    } else {
        window.attachEvent('onmessage', onShare);
    }
}
function onShare(e) {
    // Сабмит на свой сервер статистики
}
listenForShare();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question