Sunday, August 5, 2012

I'm a Tweeting Robot

Or at least I have a tweeting robot. I've had the idea to automate a twitter account for a while now after seeing other various robotweeters such as the one that tweets poetry. It doesn't do much right now (as a matter of fact its offline right now) other than tweet out a number every hour. I have been working on writing some additional functionality to tweet out the weather in the morning, a word of the day in the afternoon, and a picture of the day at night. As with all my projects this is still in its beginning stages. The program was written in Python and uses the Twitter API to tweet. Maybe someday I'll actually complete something, but until then you can follow my robot @RoboCWOOD. Below is the code I use to do it excluding my access keys and such.

Follow @RoboCWOOD

import twitter
import time
username = ""
password = ""
tweetMsg = "Hello"
count = 0
api = twitter.Api(consumer_key="", consumer_secret="", access_token_key="", access_token_secret="")
      status = api.PostUpdate(str(count))
      count = count + 1

No comments:

Post a Comment