i am making custom twitter button and counter. the counter is always returning 0.
here is the code:
<a href="https://twitter.com/intent/user?screen_name=Aoraxous" target="_blank"
data-url="http://www.twitter.com/aoraxous"
data-via="AORAXOUS"
data-text=""
data-count="horizontal">Tweet
</a>
jquery:
jQuery.getJSON(
'ht' + 'tp://urls.api.twitter.com/1/urls/count.json?url=https://twitter.com/intent/user?screen_name=Aoraxous/&callback=?',
function (data) {
alert(data.count);
}
);
any ideas what am i doing wrong?
It's returning zero count because you are not permitted to request from urls.api.twitter.com -- it's not a public API. See this thread Counting does not seem to work with other URL shortening services and Is http://urls.api.twitter.com/1/urls/count.json? a valid way to get the tweet count for a URL?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.