#!/bin/sh SFILE=$PWFILE RFILE="twitter.rb" DIR=$SOME_PATH ERROR="There is no secret file or wrong permission." if [ ! -f ${DIR}/${SFILE} ]; then echo $ERROR exit 1 fi if [ ` stat --printf=%a ${DIR}/${SFILE}` -ne 600 ]; then echo $ERROR exit 2 fi source ${DIR}/$SFILE #DIR=`echo $0 | sed 's/\/[^\/]*$//'` STATUS="`echo $* | nkf -w`" if [ "$*" ]; then curl -u $USER:$PASSWORD -d status="$STATUS" \ http://twitter.com/statuses/update.xml > /dev/null 2>&1 fi if [ -e friends_timeline.xml ]; then rm friends_timeline.xml fi wget -q --user=$USER --password=$PASSWORD \ http://twitter.com/statuses/friends_timeline.xml ruby ${DIR}/$RFILE friends_timeline.xml | tac