Update Twitter from your iPhone via the command line
This guide assumes you have a jailbroken iPhone or iPod Touch with MobileTerminal installed.
I have Twitterific on my iPhone, it’s a nice app but I’m using my iPhone on Orange and they are quite tight when it comes to decent internet access. I wanted to be able to update my Twitter feed without downloading all of the feeds that I follow. Answer: use wget to send an update.
As I didn’t want to have to type the lengthy wget command every time I set up a shell script to do this for me. Make sure you are in /var/mobile and then open nano with nano twitter-update.sh
Type in the following script:
#! /bin/sh
read -p "What are you doing?" -e tweet
wget -q http://twitter.com/statuses/update.xml --http-user=email --http-password=password --post-data="status=$tweet" >/dev/null
echo "Done"
You need to change email and password to your Twitter login details. Save and close the file.
Next open your .bashrc file with nano and add an alias to save you typing ./twitter-update.sh. Mine looks like this:
alias t='./twitter-update.sh'
Again save and close the file. Reload your .bashrc file with source .bashrc. That’s it. Now I can send a Twitter update by opening MobileTerminal and hitting ‘t’, then type in my tweet.