Skip to content

Instantly share code, notes, and snippets.

@wafitz
Created November 14, 2009 18:00
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 wafitz/234660 to your computer and use it in GitHub Desktop.
Save wafitz/234660 to your computer and use it in GitHub Desktop.
Script to automate posting of webcam images to twitpic
#!/bin/bash
# Script to automate posting of webcam images to twitpic
IMGDIR="/location_to_save_webcam_pics"
STAMP=`date +%m%d%Y_%s`
IMG="$IMGDIR/"webcam_""$STAMP".jpeg"
USERNAME="twitter_username"
PASSWORD="twitter_password" # Don't forget to escape special chars with "\"
MESSAGE="Webcam snapshot, `date`"
# Take picture from webcam
TAKE=`streamer -o $IMG`
echo "$TAKE"
# Upload to twitpic using curl
curl -F "username=$USERNAME" -F "password=$PASSWORD" -F "message=$MESSAGE" -F media=@"$IMG" http://twitpic.com/api/uploadAndPost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment