A little follow up on yesterday article about scripting Twitter with cURL: the solution was working, but somehow inconvenient. Not practical to have to go and fetch the user id every time you want to send a direct message !

This time, I scripted Twitter direct message with Perl and LWP (libwww-perl), for a much more convenient solution. I designed it to be used like a sort of universal paging service.

Running the script

Simply launch the script to get the usage :
spaghetti% ./twitter-direct.pl
twitter-direct.pl --login login --password password --to user --text
"text to send"

lets you specify the login of your Twitter account
lets you specify your password
the target user of the message
the direct message to send
So for example :
spaghetti% ./twitter.pl --login mylogin --password mypassword --to "mybuddy" --text 'Hi ! Want to go to the movie ?'

That’s it !


Download the package

Worth reading


March 18, 2007 at 7:45 pm by Stephane Kattoor
Category: Dev, Web