【问题标题】:Twitter API 1.1 does not work?Twitter API 1.1 不工作?
【发布时间】:2013-03-14 19:34:17
【问题描述】:

根据 Twitter API 1.1 文档,这应该返回数据:

https://api.twitter.com/1.1/users/show.json?screen_name=rsarver 

但我不断得到

{"errors":[{"message":"Bad Authentication data","code":215}]}

我做错了吗?

【问题讨论】:

    标签: api twitter


    【解决方案1】:

    正如Twitter API 1.1 documentation 所示,您需要通过身份验证才能访问用户/节目。

    【讨论】:

      【解决方案2】:
      You can use codebird js library for getting tweets. All you need is to create an app on twitter and note down the following :
      
      1.Consumer Key
      2.Consumer Secret Key
      3.Access Token
      4.Access Token Secret
      
      Download codebird js Library from here : https://github.com/mynetx/codebird-js 
      
      USAGE : 
      
       var cb = new Codebird;
          cb.setConsumerKey('YOURKEY', 'YOURSECRET');
          cb.setToken('YOURTOKEN', 'YOURTOKENSECRET');
      
          cb.__call(
          'oauth2_token',
          {},
          function (reply) {
              var bearer_token = reply.access_token;
          }
          );
      
          cb.__call(
              'search_tweets',
              {
                  q : "your query which you want to search",
                  from : twitter_user
              },
              function (data) 
              {
                   console.log(data);
              },
              true // this parameter required
          );
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-06-10
        • 1970-01-01
        • 2013-06-09
        • 1970-01-01
        • 2012-08-19
        • 2014-08-06
        相关资源
        最近更新 更多