Twitter client in 3 bash lines.

3
Sep
0

Ok, i’m lying. It’s not full twitter client. It’s the one for posting your status updates. So, today i was sitting and thinking how it’d be cool to tweet straight from the shell while messing around with git branches and editing code in vim. Looking at twitter api i noticed that for “poking around API” it’s possible to send a simple request with curl to post your status. And then the lightbulb lit above my spiky head!

#!/bin/bash
read -s pass
url="http://eimantas:$pass@twitter.com/statuses/update.xml"
curl -d "status=$*" $url

Save it whatever you want and add execution attribute with $ chmod +x

This code could have some alterations like writing a message against custom password instead of command line dirrectly. Or you could keep your username in some sort of ~/.twitrc file.

Enjoy this article?

Consider subscribing to our RSS feed!

Tagged as: ,

No Comments

No comments yet.

Leave a comment

RSS feed for comments on this post