Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Gao-Jerry/Crawler

Repository files navigation

Get the Twitter API key

  1. Visit the Twitter Developers site and sign in with your Twitter account
  2. Go to Twitter Application and create an Twitter application. (Your interface may different from mine.) apps
  3. At the detail page, you can see the API key & secret. detail API key
  4. Then generate the access token and secret. generate access token

Crawl the Tweets

  • Some libraries will help you crawl the data. (BTW, I used Tweepy)
  • The above API key is used when crawling the data. My code is as follows:
import tweepy

auth = tweepy.OAuthHandler("Your API key", "Your API key secret")
auth.set_access_token("Your access token", "Your access token")
api = tweepy.API(auth)
  • You can refer to the GET statuses/lookup method to get tweets by ID. It can get up to 100 tweets at a time. My code is as follows:
api.statuses_lookup("Your ID list (max 100)", tweet_mode='extended', include_entities=True)

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages