#!/bin/bash
uid=""
pw=""
maxLen=140
tweet="$*"
len=${#tweet}
if [ ${#tweet} -gt $maxLen ]
then
echo "Tweet too long"
exit
fi
curl -u $uid:$pw -d status="$*" http://twitter.com/statuses/update.xml >
/dev/null 2>&1
if [ $? -ne 0 ]
then
echo "failed to tweet"
else
echo "Tweeted"
fi
No comments:
Post a Comment