简体   繁体   中英

Can I get latest tweets from twitter without using access token and access token secret?

I am able to successfully display the latest tweets of my app on my website when using all four keys supplied by Twitter (consumer key, consumer secret, access key and access key secret). However the TwitterOath code I'm using (by Abraham Williams https://github.com/abraham/twitteroauth ) seems to split the two different kind of authentications:

 function __construct($consumer_key, $consumer_secret, $oauth_token = NULL, $oauth_token_secret = NULL) {
     $this->sha1_method = new OAuthSignatureMethod_HMAC_SHA1();
     $this->consumer = new OAuthConsumer($consumer_key, $consumer_secret);
     if (!empty($oauth_token) && !empty($oauth_token_secret)) {
          $this->token = new OAuthConsumer($oauth_token, $oauth_token_secret);
     } else {
          $this->token = NULL;
     }
  }

As I understand it, you can simply not specify the access key and access key secret and still have the consumer working (as the access stuff allows you to do things as the user).

Basically, I would like to display tweets without specifying access key and access key secret (because my client doesn't want to supply me with those credentials!). The problem is that when I do not specify them I get a "Bad Authentication data 215" error.

Does this mean that it is not possible to display using statuses/user_timeline.json without supplying all four keys?

Hope this is clear enough!

Thanks

From Twitter API v1.1 documentation ,

search queries will need to be authenticated in version 1.1

This is required so that they can limit the rates. Twitter API v1 is retired as of 11 June 2013. You can now use only v1.1

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.

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