12

Tip #767   Twitter from the terminal

I wrote a small script, I named it "tw" to update twitter from terminal:

#!/bin/bash
echo "Your message please..."
read MSG
echo $MSG > characters
echo "Message length"
wc -c characters
echo "Password please..."
read -s PW
wget --keep-session-cookies --http-user=your.email@address.here --http-password=$PW \
    --post-data="status=$MSG" \
    http://twitter.com:80/statuses/update.xml
echo "Message posted."

This can also be used to update identi.ca (the open twitter alternative) by replacing the twitter url with 'http://identi.ca/api/statuses/update.xml'.