This Fun And Fearless Twitter Bot Invents New Fanta Flavors Every Hour

What happens when you get disappointed by that orange-flavored sparkling drink you love so much? Well, if you’re a developer, you could build a Twitter bot that invents new weird flavors every hour. 

Laura Gonzalez is a Spanish-born developer, who happens to love orange Fanta. But when she moved to the UK, she soon realized that the sparkling drink didn’t taste quite as good as it used to in her home country. When she looked up the ingredients, she noticed the UK variant contained extracts from carrots and pumpkins. To say she was surprised – and disappointed – is an understatement.

Laura thought of different ways to express her frustration, before concluding that a Twitter bot would be the funniest way to go at it. “I sort of was meaning to do a jokey [blog] post about carrot and pumpkin Fanta, and I was just like ‘wait, this could be a bot’,” she said.

The result is hilarious. Laura built a bot that randomly combines a valid Emoji, a qualificative adjective, and some text for the tweet. Her custom code turns all of this into a JSON object which, in turn, renders it as a webpage. Laura then runs a shell script she created to visit the webpage, take a screenshot, and finally send the text and photo to Twitter via its API.

“This all sounds super complex, but the beauty of Node is that it has packages for literally everything, so it’s a bit like putting legos together. The actual code is probably under 1000 lines total,” she explained.

So far her bot has created and tweeted dozens of hilarious heinous Fanta flavors. See it for yourself:

https://twitter.com/fakefantas/status/998279980755939328

https://twitter.com/fakefantas/status/998209030656086016

https://twitter.com/fakefantas/status/998209166744399875

https://twitter.com/fakefantas/status/998208955993255937

Check all of Laura’s fun and fearless Fanta flavors on Twitter: @FakeFantas

[box]Read next: Flopstarter Is A Crowdfunding Platform For Bad Ideas[/box]