【问题标题】:Display Twitter Follower Count with Twitter API 1.1使用 Twitter API 1.1 显示 Twitter 关注者数量
【发布时间】:2013-06-11 16:45:20
【问题描述】:

我一直在使用 twitter API 1.0 来非常轻松地获取我的关注者数量:

$json_string = @file_get_contents('https://api.twitter.com/1/users/lookup.json?screen_name='.$twitterscreenName);
      if($json_string)
      {
         $data = json_decode($json_string, true);
         $data = number_format($data[0]['followers_count'], 0, ',', '.');};

现在 twitter 已经将他们的 API 更新到 1.1,这已经停止工作了。

有没有一种简单的方法可以从用户名中获取关注者数量(我目前有超过 100,000 个关注者,这是 API 的问题吗?)

我问这个是因为我使用了一种结果为 5000 的方法,我真的不明白。

【问题讨论】:

    标签: php json api twitter


    【解决方案1】:

    您需要先使用注册帐户向 Twitter 进行身份验证,然后才能向 API 发出请求。除此之外,改变

    api.twitter.com/1/
    

    api.twitter.com/1.1/
    

    更多关于身份验证的信息可以找到in the API documentation

    【讨论】:

      猜你喜欢
      • 2015-03-14
      • 1970-01-01
      • 2021-11-25
      • 2013-07-01
      • 1970-01-01
      • 2013-08-19
      • 2016-09-28
      • 2020-12-22
      • 2011-09-20
      相关资源
      最近更新 更多