I gave some thought about how I was going to remember to contribute something to this Twitter feed. There is no point to having Twitter with no tweets! However, that is easier said then done.
Then I remembered that the automation I use for managing the Club is mostly done in Python (with a little Microsoft Access) which interacts with the database (MySQL) and the internet (web site, email, etc.). I wondered if I could use Python to interact with Twitter? "Yes" is the answer.
A Python wrapper around the Twitter API has been created, called Python Twitter. After installing this in Python, three lines of code are required to post a tweet:
import twitterapi=twitter.Api(username='something',password='something')api.PostUpdate("Hello World!")
I've added this into my little program that manages club information. When I make changes to information (new directory, email to members, etc.) I now have in front of me the option to send a tweet on the same subject. Since this is almost automatic, it is likely to happen.
No comments:
Post a Comment