Tweet-chan was concieved and programmed at the 2016 HackIllinois Hackathon. The goal of Tweet-chan was to develop a powerful script with real world implictions using simple python code. After reading an article about Twitter-bots, I stumbled upon Tweepy, an API that intrigued me. Thus, I decided to use it to create my own personal Twitter-bot.

What it does

Tweet-chan works in 2 steps:

Step 1: Upon activation, Tweet-chan will take a simple text file and scan it for invalid tweets. If an invalid tweet is found, the user is notified and the program finishes.

Step 2: Tweet-chan will activate a cycle that will loop indefinitely. The cycle begins with with Tweet-chan choosing a random tweet and posting it. Tweet-chan will then look for new followers, following any user who follows it. The cycle ends with Tweet-chan putting itself to sleep. After this sleep period is over, the function recurses and the cycle begins anew.

The bot itself runs on a Raspberry Pi. This allows it to run 24/7.

An implementation of Tweet-chan, Trump-chan, is currently running. The purpose of the bot is to produce Donald Trump quotes every half-hour.

How I built it

Utilizing Tweepy.api, Tweet-chan was built using a simple text analysis algorithm, which it uses to search the .txt file and to create tweets.

After the files were created, they were uploaded to a Raspberry Pi and activated.

Challenges I ran into

A particular challenge I ran into was trying to implement a clock that would tweet a special message at a given time. Limitations in the time import made it difficult to directly compare times. In the interest of time, I implemented a simple counting algorithm to dictate when the special tweet should be released.

A second challenge was the inability of python to combine integers and strings. Coming from Java, I was take aback by syntax errors that would've been perfectly fine in my past projects. In the interest of time, I excluded appending numbers to the special tweet.

Accomplishments that I'm proud of

This is my very first hack, as well as the first project I have ever completed with real-world implications.

What I learned

I became more familiar with python and it's syntax. I also learned how to utilize APIs in my projects. Finally, I became familiar with the Raspberry Pi.

What's next for Tweet-chan

The future of Tweet-chan is unclear. At a later date, it is my intention to add an app interface to the program. Whether the app will expand into a larger creation or remain a small pet-project remains to be seen. For now, please enjoy Tweet-chan and it's implementation, Trump-chan.

Built With

Share this project: