Created
November 13, 2009 23:40
-
-
Save To1ne/234269 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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