Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
MY_PIC="$1" ## filename of the picture to upload ##
ALBUM_ID=6008849823888405298 # ID of picasaweb album
PIC_TITLE=`basename $MY_PIC` # filename w/o extension
PIC_TYPE=`file -b --mime-type "$MY_PIC"`
ACCESS_TOKEN=$( ## Acces token is managed with Python's script now
## Note that ALBUM_XML URL starts now from https:// now
URL=`curl -s --request POST --data-binary "@$MY_PIC" \
--header "GData-Version: 2" --header "Slug: $PIC_TITLE" \
--header "Content-Type: $PIC_TYPE" -H "Authorization: Bearer $ACCESS_TOKEN" $ALBUM_XML | \
sed 's/.*media:content url='"'"'\([^'"'"']*\).*media:thumbnail url='"'"'\([^'"'"']*\).*/\1/'`
echo $URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment