简体   繁体   English

twitter计数总是返回0?

[英]twitter count always returns 0?

i am making custom twitter button and counter. 我正在自定义Twitter按钮和计数器。 the counter is always returning 0. 计数器始终返回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的:

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. 它返回零计数,因为不允许您从urls.api.twitter.com请求-它不是公共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? 请参见此线程。 计数似乎不适用于其他URL缩短服务,并且http://urls.api.twitter.com/1/urls/count.json是吗? a valid way to get the tweet count for a URL? 一种获取网址推文计数的有效方法?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM