Created
November 14, 2009 18:00
-
-
Save wafitz/234660 to your computer and use it in GitHub Desktop.
Script to automate posting of webcam images to twitpic
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
#!/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