Around two months ago I decided to start developing a Twitter bot using a Python library called Tweepy. At first the idea was simple. I wanted to create a bot that posted cute images to twitter automatically. I built A large file full of royalty free cute images which would be selected at random and posted.
This was fine for a while – but I grew bored of the same content going out so added ‘Mania’ – a randomly generated number that would post different content based on the bots ‘mood’. The bot posts automatically at 10 minutes past the hour as long as one of my PC’s is turned on.
Later this mechanism evolved into an external variable that would randomly increase of decrease – and to top it all off new followers would make the bot happy, and fewer followers would make it sad. We’ll have to see what happens!
The program is stored on my OneDrive – and consists of 3 main files:
AI.pyw #The file that posts to Twitter
cuteBrain #Stores the mania level and previous follower count
Timer.pyw #set to run on PC startup – this file runs AI.pyw invisibly at 10 past the hour.
Running on the OneDrive means I can run the program from my home PC and work station.