Twitter Bot

Ok… So… Trump’s administration has made it known that they do not believe climate science. As a result, I have taken it upon myself to collect a MONSTER list of links to climate research to be used in a Twitter Bot.

Step 0: Create a .txt file that is nothing more than a list of links to climate change data!

Step 1: Set up one of my RaspberryPi’s to work headlessly.

Step 2: PYTHON!

Step 3: Setup Twitter Bot page.

Step 4: RELEASE THE BOT!

Step 5: …hmmm… so I’ve got the code to work. But… it seems after about 4 posts(2 hrs), the bot stops working…. This is annoying. Scratch head and return.
…Best guess, the server is timing out. Worst guess… Twitter bots work on pizza and beer and mine has neither.

*Will return to make this into a tutorial.*


16Feb17

I just discovered how to fix the “timing out” problem. I had a “derp.” need to use:

Crontab -e

It will let me run the code at set times. So if I rewrite the code to select a line at random… I should be in the clear. But it also means I need to figure out how to deal with the exceptions/errors it sends back when a tweet is repeated.


17Feb17

Bot appears to be working:

https://twitter.com/alt_climate


19Feb17

The Twitter Bot is most definitely working!

https://twitter.com/alt_climate

You can find the tutorial and examples that I am putting together here:

https://github.com/AltClimate/Twitter_Bot

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s