Pentametron creates sonnets out of users’ tweets

This is certainly a lot better use of a Twitter bot than most. It’s just the sort of high-concept bot I would love to do, if only I had a decent idea for one. And I bet it’ll irritate real poets, like Cuttlefish, for its (present) flaws.

Creator Ranjit Bhatnagar built, in PHP, a script that searches Twitter’s millions of tweets an hour for any and all tweets that match iambic pentameter scansion, finds rhyming couplets, and compiles them together into a sonnet. And considering the source, there’s some amazingly deep stuff! For instance:

still haven’t eaten anything today…
Have had a lotta nicknames growing up
BOO Chelsea !! Liverpool deserve the cup !!
Blue is the Color, Football is the game…

Fame of the money, Money of the fame.
Do not appreciate the referee.
REMEMBER LOVE, REMEMBER YOU AND ME
So many babies at the outlet mall

Abundant Life Assembly welcomes all! :D
Its fucking hailing! Hail! In fucking May!
im shirted up… and ready for the day!
Tomorrow Baby Steps and Twinkle. \O/

I was invited to the city tho :)))))
i Hit the mall and spend a G today .

See!? Civilization has totally achieved its purpose, the world can end now.

[Read more...]

Python Twitter-bot Framework

I’m working on a Twitter bot to be used for the upcoming episode of Mock The Movie this Thursday, and I have every intention of participating as often as humanly possible, if not the least way by running this bot when necessary.

If you’re a Python developer and are interested in building a Twitter bot, go get Tweepy and feel free to start with this framework. You’ll need to register your application with Twitter first, of course. Read the Twitter OAuth FAQ for more details.

The code for authenticating against Twitter was originally borrowed from Nessy’s Blog, but the site design that Nessy was regex’ing against to try to scrape the auth tokens out of has since changed. I’ve updated it, and included caching these tokens in plaintext files in the program folder. Nessy’s code will only run the first time.

Additionally, my bot will work in daemon mode, performing work every so many seconds according to the configuration of the iterationtime variable. You end it by hitting Ctrl-C.

To get started, enter your application consumer_key and consumer_secret, as well as the username/password for the account you’d like to connect it with. Put all the actual work you’d like to perform at the bottom, where marked with a comment. The Tweepy API specifications are very well documented, but if you’re having specific problems, I might be able to help. By the time anyone reads this and gets to that point, I’m sure I’ll have my own bot done. Good luck! Code below the fold.
[Read more...]