For those of you who are on Twitter, you might appreciate TweetSpeak. It makes Twitter a bit more like office banter by speaking it in the background. Here are some updates I made to it — basically, I added some error handling to deal with having too many client requests, put a few more substitutions in so that Alex figured out how to translate Twitterese like “kthxbye” and “crrrrrraaaaaaaaaaaaaaaxzy”, and generally cleaned up Twitterisms in the feed.
This code is released under the GPL 2, and is based on the original by Ward Cunningham.
#!/usr/bin/perl
# Copyright (c) 2008, Cunningham & Cunningham, Inc
# Enhanced by Smokejumper Consulting
# Released under GPL v2.
my $user = 'YourUser:urp@ssw0rd';
my $db = $ENV{'HOME'} . '/.tweet-db';
my $current;
$current = `cat $db` if -e $db;
print "Using database at $db\n";
while (1) {
twitt();
`echo $current > $db`;
sleep(180) if $user;
}
sub twitt() {
#`say -v Victoria tweet tweet?`;
my $xml = $user
? `curl -s -u $user http://twitter.com/statuses/friends_timeline.xml`
: `curl -s http://twitter.com/statuses/public_timeline.xml`;
if($xml =~ m|
3 Comments
darn you kids and your fancy lingo. in my day, FTW most certainly did not mean “for the win”. no wonder no one thinks my “punks not dead. FTW” tattoo is cool anymore.
Hamlet – I always thought it meant F*** the world! What does it mean in relation to your tatoo?
Okay, I may need to start a Google Code repository for this. It’s changing pretty regularly as I bump into new stuff to add.
2 Trackbacks
[...] the previous post. I updated the source code to handle “ocaml”, “jocaml”, “+”, [...]
[...] had a bunch of people join Twitter, and that was kind of neat, particularly when hooked up to TweetSpeak — it was like the last Monday of the month all the time. I got lots of good tips about [...]