2 # a twitter client (uses .netrc for authentication)
5 echo " use: $(basename $0) -h | [ tweet ]"
7 echo " no arguments gets latest updates"
12 curl
--connect-timeout 5 -s -n $1 |
awk '
19 /text/ { sub(/<[^<]*>$/,"",$0); m=$0 }
20 /created_at/ { sub(/<[^<]*>$/,"",$0); at=$0 }
21 /_name/ { sub(/<[^<]*>$/,"",$0); x[++i] = $0 " : " m "\n\t[" at "]" }
22 END { for(j=i;j>0;j--) print x[j] }
27 curl
-s -n -d "status=$msg" $1 &>/dev
/null ||
echo "tweet broke"
30 if [ -t 0 ];then msg
="$*";else msg
="$(cat -)";fi
33 update http
://twitter.com
/statuses
/update.xml
35 friends http
://twitter.com
/statuses
/friends_timeline.xml