Update twitter from command line!
July 5, 2009
Are a command line freak like me! ever wanted to tweet from commanline ? Don worry Commandline Fu has the answer..
First you’ll need to have curl command in your path. if you don have install it by sudo apt-get install curl on ubuntu.
You ‘ll need to put a line “machine twitter.com login TWITTERUSER password TWITTERPASS” in $HOME/.netrc and better chmod 600 that file.
Then use this command.
$ curl -n -d status='Hello from cli' https://twitter.com/statuses/update.xml
Thanks Commandlinefu.com
Update :
A script version without netrc dependence (also prevents blank status updates): thanks Dan
#!/bin/sh
# usage: ./update.sh STATUS
if [ "x${1}" != "x" ]; then
curl -u twitterid:password -d “status=${1}” https://twitter.com/statuses/update.xml
fi
July 5, 2009 at 6:31 pm
Nice one
July 5, 2009 at 6:53 pm
A script version without netrc dependence (also prevents blank status updates):
#!/bin/sh
# usage: ./update.sh STATUS
if [ "x${1}" != "x" ]; then
curl -u twitterid:password -d “status=${1}” https://twitter.com/statuses/update.xml
fi
July 6, 2009 at 11:21 am
hey thanks for the script.. looks good now.
July 6, 2009 at 9:27 am
thnx man u r great