Skip to content

Preston-Young/Twitter-Hello-World

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Twitter-Hello-World

Twitter Bot

This is a Twitter Bot I build in Python using the Twitter API

Using the API, my bot would parse through my user's "mentioned timeline," which is the collection of any tweets that tagged my account. For each tweet, if the original owner of the tweet used the hashtag #HelloWorld (not case sensitive, so #HelLOwoRLD would work too), my bot would automatically tweet a reply with a pre-written message that I choose. I hosted my bot on pythonanywhere.com, and using the time.sleep() method, my bot continuously checks every 15 seconds for any new tweets.

What I liked about this project

Even though this was the smallest project I've built, I spent a lot of time learning the API, reading the documentation, and testing on my own to figure out what information I needed to extract. It was satisfying being able to build a bot that interacted with a technology that I use so frequently.

What I want to implement in the future

In the future, I want to use my new familiarity with the Twitter API and integrate Google's Natural Language API. My idea is to look at all of the tweets under the top trending hashtags. By using machine learning and Google's Natural Language API, I plan to parse through all the tweets under each hashtag in order to generate the overall emotion for each one to display for the users.

Here's a sample interaction of my bot running on pythonanywhere.com's cloud console

Terminal Interaction

Here's what an automated reply from my bot would look like

Sample Tweet Reply

Here are a few tweets where I mention my user, but notice that only the tweet containing the hashtag #HelloWorld received a reply from my bot

Sample Tweets

About

Twitter Bot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages