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
Usage:
twitter-direct.pl --login login --password password --to user --text
"text to send"
Options:
–login
lets you specify the login of your Twitter account
–password
lets you specify your password
–to
the target user of the message
–text
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
Worth reading
- Twitter : Send free SMS messages to your friends : now you can do this from the command line
- Scripting Twitter with cURL
- Scripting Twitter with Perl + LWP : a script in Perl doing the same thing (much simpler).
- Perl+Twitter : Getting @mentions from command line
Related
- Here is another command line tool for twitter : Twitish.
- Twitter in a color Terminal
Awesome. I should make good use of this, merci ! 🙂
thanks for your posts..great share for learners
Hi,
I am pretty new to Curl and I am trying to post data onto the URL using perl since I need it to be in an iterative manner.Found that the post above might help me out in doing the intended. Can anyone point me out the place where I can find the script “twitter.pl”.
Thanks in advance.
I found the answer in google, remove the topic pls.