문제

Has anyone figured out how to only increment share counts if the sharing action is completed?

They seem to count clicks.. not completed shares. That isn't a stat that is profoundly meaningful to me.

도움이 되었습니까?

해결책

You can set it so the count displays the 'native' count:

<script type="text/javascript">stLight.options({ 
    publisher:"Your publisher key", nativeCount:true 
});</script>

However this only seems to work for Facebook, LinkedIn and a few others. For Twitter, I just replace the ShareThis count with the actual count obtained from the Twitter API, once ShareThis has loaded and the ShareThis markup exists on the page:

var pageUrl = 'http://www.google.com/';

updateTwitter();

function updateTwitter() {

if (jQuery('.st_twitter_vcount .stBubble_count').length > 0) {
    jQuery.getJSON('http://urls.api.twitter.com/1/urls/count.json?url=' + pageUrl + '&callback=?',
    function(data) {
        jQuery(".st_twitter_vcount .stBubble_count").html(data.count);
    });
}

else {
    setTimeout(function() {
        updateTwitter();
    }, 50);
}

}

Just change the pageURL variable to the URL you want to display statistics for.

Hope that helps,

Kamal.

다른 팁

Ended up rolling my own. Neither seems to support this.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top