TwitterTrack — tracking tweets using Tweepy #BeginnerProject

Things you’ll be comfortable with by the end of the blog:

Get started with Twitter

Tweepy

pip install tweepy
auth = tweepy.OAuthHandler(API_KEY,API_SECRET_KEY)
auth.set_access_token(ACCESS_TOKEN,ACCESS_TOKEN_SECRET)
api = tweepy.API(auth)
public_tweets = api.home_timeline()
for tweet in public_tweets:
print(tweet.text)

Streaming those live tweets

#override tweepy.StreamListener to add logic to on_status
class MyStreamListener(tweepy.StreamListener):

def on_status(self, status):
print(status.text)
myStreamListener = MyStreamListener()
myStream = tweepy.Stream(auth = api.auth, listener=myStreamListener)
myStream.filter(track=['python'])

Last word

--

--

--

Sipping my coffee in a warm cafe, a book in hand, waiting for my DL model to finish training

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

One of the missing piece within Solana ecosystem: Deeeep analytics.

Why MVC is not a pattern

Simplifying Product Complexity

Making modules for Polybar (Shell + Python)

Production Debugging Challenges and How to Overcome Them

Implementing a Containerd Plugin for Container Operations using gRPC

Understanding MIPS in 2021: What to Know about the Final Rule, Higher Standards and COVID-19

Velocity Anti-Patterns

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Enfa Rose George

Enfa Rose George

Sipping my coffee in a warm cafe, a book in hand, waiting for my DL model to finish training

More from Medium

How To Authorize a User Using the GitHub OAuth API , Python and Flask: Part Two.

Music Genre Classification with Mel Frequency Cepstral Coefficients (MFCC) in Google Colab

Display currently playing Song with Spotipy API in Flask.

Covid-19 cheast x_ray_image Classification(CNN)end_to_end with streamlit .Deploy