简体   繁体   中英

twitter api how to search for users

I need to create an application that uses Twitter's API to search for users.

But i need to make it so i dont have to interact with it. The problem i am having is that when i connect to the API using my twitter account it comes up with a message asking it I want to allow <> to access my account.

is there a way to get an access token that doesn't expire and append it somehow to the API call URL I need:

http://api.twitter.com/1/users/search.json

OAuth tokens (essentially) do not expire.

When you authorize your app to use your Twitter account; twitter gives you two tokens: OAuthToken and OAuthTokenSecret. Store these in a cookie/settings file/whatever. Then, when you want to make an authorized call, you provide those tokens to Twitter as part of the request.

There are lots of Twitter libraries that do this heavy lifting for you. I would recommend finding one that suits the platform you are using. Writing OAuth code from scratch is really time-consuming and unfun.

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