twitterImgBot: a simple image twitter bot

Joaquin L. Pereyra
Avalanche of Sheep
Published in
1 min readJun 7, 2015

I released the first version of my small image twitter bot some months ago. But it was still quite incomplete, and the code was pretty ugly. Some days ago, I improved on my creation. It is still not very complicated, but it can sure be useful: @gentelindaOK is still going strong only depending on this small script running on my computer. Compared to the previous version, the script now features:

  • Cleaner code!
  • Random time interval between twitts! You can now set an execution chance for the script, which allows for more human-like behavior.
  • A separate config file where you can set you API tokens and keys, the source folder and the execution chance of the bot

You can find the new version on github.

I have also commited my modification of HoverHell’s RedditImageGrab so it can now take multireddits as an argument. HoverHell hasn’t accepted my pull request yet, but you can find it in my own repository. This is very helpful when you want to build your source folder: just suscribe to Reddit, browse around for some image-oriented subreddits, create a multireddit for them and command RedditImageGrab to fetch you the images posted.

As I had previously stated, ideally you should use a task scheduler (for Linux users cron works great) to set up the execution of the bot and the image fetcher. It is recommended to have a Duplicate Files remover too. You’ll also need Python and Tweepy installed.

--

--