A Python Twitter bot that writes Onion headlines

Python is such a great programming language, I like to tinker with it. Seeing how easy it is to use libraries like Markovify and Tweepy, I decided to make my own Twitter bot.

Inspiration came from the Speld Bot—De Speld being a Dutch version of the Onion. I call mine The Onion bot and it recreates headlines from The Onion. It does this by first scraping the website and RSS feed of The Onion and storing all the headlines. It then uses Markov chains to generate new headlines and publishes them on Twitter every hour. It is hosted on Heroku, which was actually not that difficult to figure out.

Check out the bot here and the code here.

Some of my favorite headlines:

Glimpse Of Father’s Toenails Offers Boy Petrifying Vision Of Future In Which Women Never Speak To Each Other

Kavanaugh Sobering Up After 35-Year Bender Shocked To Find Out He’s Supreme Court Nominee Keeps Talking About How Much He Respects Women

What If We Could Live In A World Of Uncertainty And Pain

This one felt a bit too real:

Girls Banned From Flight For Speaking Arabic

And of course the classic:

Hope you like it!