Android and Linux

Thursday, November 4, 2010

Finally, a use for twitter

I've never had much use for Twitter but I've recently found myself using my phone to log into my computer to check various things throughout the day. While I have those things set up with GScript shortcuts for quick checking, there's no reason I need to manually be logging in to check them.

You used to be able to post to twitter with curl, but not since they switched to OAuth. Now the simplest way is with TTYtter, the command line Perl Twitter posting script.

Once you run TTYtter and set up your login info, you can post to Twitter using ttytter -status="blah blah blah", but I usually like setting up things to use either pipes or argument type input, plus I'll never remember the name ttytter, so I use this little script named "twit"
#! /bin/sh
if test -z "$1"

then
in=$(cat /dev/stdin)
ttytter -status="$in"

else
ttytter -status="$@"

fi
which can be used in two ways:

command | twit

or

twit blah blah blah

I set up a private twitter account and use TTYter to push various information to it. Some information comes from and hourly cron and for others that run at unexpected times, I just added "| twit" to them.

I use LauncherPro on the phone and it comes with a twitter widget. Set to update every 30 minutes, I just look at the widget to get an update on pretty much anything I may be interested in.

Followers