A long time ago, when nearly everybody I ever (thought I) wanted to talk to used goofey to communicate, one particular friend would often ask "what doing?". twitter seems made just for people like him. So in a retro moment I wrote some Perl to answer the age-old question from the comfort of the command-line, via twitter. It's called wd.
Once I'd written the "get" support, it wasn't too hard to add "set" support.
To use it, you'll need the Perl JSON module, and LWP. [update: and also DateTime::Format::Strptime - it'll sort the output by date, now.]
Getting status:
for all your friends
% wd yeled: dreaming about driving into Western Australia as a fugitive a lot lately.. (about 16 hours ago) wally: Sitting (about 21 hours ago)
for one particular friend
% wd wally wally: Sitting (about 21 hours ago)
Setting status:
% wd -sv blogging. overdue for sleep status set to: blogging. overdue for sleep
(if you leave the -v option out it'll shut up unless there's an error, in true Unix style.)
[update: there seems to be missing data in the feeds - if somebody marked their status as "friends-only", then you don't get a status object for them in the JSON and XML "friends status" feed. i've asked about it...]
Anyway, here's the script. Have fun!
size: 4 KB.
last modified: 2008-06-07.
23:18
geek
Comments have been closed for this post. If you've got something to say, please contact me by other means. Thanks!
Archives
...the last 3 months :
Recent Posts
Posts Recently Commented Upon
Ten Most Recent CDs
Currently Listening To
(thanks, last.fm.)
Other Recent Listening
Hair
sorta dark red with one blond bit.Wasting Time On
Links
Help Save The World
I may not (so far) run the kind of blog that posts social conscience linkage - other friends seem to have it covered better than I could manage (yes, I'm aware that's no excuse), but this doesn't mean that I don't care about the State of ThingsTM.
i donate to :
but there's other things worth worrying about too, like :
Looking For Something ?
Feed ?
yes indeed - a merged feed of my flickr photos, del.icio.us tags and posts here:
Licensing

This weblog is licensed under a Creative Commons License.
Comments (6)
just when i was getting bored with twitter - i am re-energized!
Posted by yeled | January 9, 2007 12:06 PM
Posted on January 9, 2007 12:06
Hmm. It was rather buggy. The version number is 1.09. I get all sorts of strange errors, - and it doesn't look as nice as yours.
I got it working a bit - but now I doesn't work anymore. Strange hardcoding the local timezone to australia.
Can't call method "strftime" on an undefined value at /usr/share/perl5/DateTime/Format/Strptime.pm line 805.
Everything is installed correct. --- But I see the version is older as the people doesn't have «:» after their nicks.
odin@acona:~$ wd
forteller Klart jeg m� slenge ut en test-post til twitter. Vet ikke helt hvordan jeg skal forholde meg til dette enda, om jeg kommer til � bruke det, og i s... (2006-11-22 01:52:15)
And it's not in UTF8, but AFAIK Twitter doesn't send that.
Posted by Odin / Velmont | April 24, 2007 10:18 PM
Posted on April 24, 2007 22:18
Yeah, things have changed a bit since it was originally posted:
- twitter no longer provides relative dates via the API, so changed it to print boring-looking datestamps.
- i removed the colon so it'd flow a bit more like a sentence (which is how a few of us seem to use it).
I've just removed the Australian guff from it - sorry about that. You're the second person to give me any feedback on it, so it hasn't had a heap of testing beyond the standard "it works for me" disclaimer (and I'm still using it pretty much every day).
When are you seeing the strftime error? when you're setting your status with -s or just running it to see what other people are doing? is it happening every time?
Thanks,
Cos.
Posted by cos
|
April 24, 2007 10:38 PM
Posted on April 24, 2007 22:38
It won't work for me... I get this:
Can't locate JSON.pm in @INC (@INC contains: /System/Library/Perl/5.8.6/darwin-thread-multi-2level /System/Library/Perl/5.8.6 /Library/Perl/5.8.6/darwin-thread-multi-2level /Library/Perl/5.8.6 /Library/Perl /Network/Libra
BEGIN failed--compilation aborted at /usr/local/bin/wd line 63.
I tried doign the obvious $ sudo cpan install JSON
But it failed after about an hour of building dependencies with some test error, and I didn't have the heard to try again. What do I need to install to use this script? It's always a must to tell people that when and where you distribute software d-:
Posted by teh elliottcable | May 15, 2007 9:12 AM
Posted on May 15, 2007 09:12
P.S. my bad for being a retard, you did specify that you needed the JSON module (-:
Posted by teh elliottcable | May 15, 2007 9:13 AM
Posted on May 15, 2007 09:13
hm. "after about an hour of building dependencies"? you didn't let it try and build a new version of Perl or something, did you?
Posted by cos | May 15, 2007 10:25 AM
Posted on May 15, 2007 10:25