Monday, September 28, 2009

Mass Update Script


#!/bin/sh

# post the arguments as the update text
status="$@"

# update whatisMYNAMEdoing.com via FTP
# i know, i know - FTP {is dead,must die} and long live SFTP instead
html="<html><head><title>What is MYNAME doing?</title></head><body><center><h2>MYNAME $@</h2><h1>No</h1></center></body></html>"
echo $html > index.html

ftp -n ftp.whatisMYNAMEdoing.com >/dev/null 2>&1 <<END_SCRIPT
quote USER username
quote PASS password
cd /path/to/htdocs
put index.html
quit
END_SCRIPT

# update twitter
curl -u username:password -d status="$@" http://twitter.com/statuses/update.xml >/dev/null 2>&1

# update facebook
/usr/bin/php fbcmd.php STATUS "$@" >/dev/null 2>&1

# update blogger
echo "$@" | mail -s 'MYNAME...' bloggerID.bloggerPassword@blogger.com >/dev/null 2>&1