Monday, September 28, 2009

Mass Update Script


# post the arguments as the update text

# update 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 >/dev/null 2>&1 <<END_SCRIPT
quote USER username
quote PASS password
cd /path/to/htdocs
put index.html

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

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

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