Skip to content

Instantly share code, notes, and snippets.

@To1ne
Created November 13, 2009 23:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save To1ne/234269 to your computer and use it in GitHub Desktop.
Save To1ne/234269 to your computer and use it in GitHub Desktop.
function beech() {
len=`echo "$1" | wc -m`
if [ "$len" -gt "140" ]
then
echo "Tweet length is $len, exceeds max. 140 characters"
return
fi
echo -n 'Sending Tweet... '
# TODO correct parameter for extended regexes => BSD: `sed -E`; GNU: `sed -r`
/usr/bin/curl -Ss -u $TWITTER_BEECH_USER:$TWITTER_BEECH_PASS -d status="$1" http://twitter.com/statuses/update.xml | grep 'error' | sed 's/<[^>]+>//g'
echo ' DONE!'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment