Twitter bot

Mar. 2nd, 2011 10:25 am
jodi: (Default)
I decided to start learning Python by creating a Twitter bot. I have an online diary, that I have been keeping for over a decade now, and I decided that I would output lines from it as tweets, so that I could keep in touch with my younger self. If you want to see it in action: Echochild.

Things I found odd to start with in Python )

There are quite a few Python to Twitter packages, but in the end, I decided upon Tweepy.Installing Tweepy )

I formatted the diary entries, using Vi, so that there is just one sentence per line.

I got the appropriate authorisation tokens from Twitter: consumer token, consumer secret, etc.

Due to access restrictions, I am unable to run cron jobs or leave things running in the background, so concluded that being able to tweet just by going to a web page would do. Not quite automatic, but still, will do for now.

I then created a CGI script in the joshthecoder-tweepy-fcaff74 directory.CGI script )

The next thing to do is make it actually reply to people!

April 2014

S M T W T F S
  12345
6789101112
13141516171819
20212223242526
27282930   

Syndicate

RSS Atom

Most Popular Tags

Expand Cut Tags

No cut tags