Created
July 18, 2015 14:11
-
-
Save hrpunio/31e35d0987c81029e3ce to your computer and use it in GitHub Desktop.
Create album @ picasaweb
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 | |
ALBUM_TITLE="$1" # Album title | |
ALBUM_DESCR="$2" # Album description | |
Album_Keywords="$3" # Album keywords (comma separated) | |
ACCESS_TOKEN=$(oauth2picasa.py) ## Acces token is managed with Python's script now | |
MESSAGE="<entry xmlns='http://www.w3.org/2005/Atom' | |
xmlns:media='http://search.yahoo.com/mrss/' | |
xmlns:gphoto='http://schemas.google.com/photos/2007'> | |
<title type='text'>$ALBUM_TITLE</title> | |
<summary type='text'>$ALBUM_DESCR</summary> | |
<media:group><media:keywords>$Album_Keywords</media:keywords></media:group> | |
<category scheme='http://schemas.google.com/g/2005#kind' | |
term='http://schemas.google.com/photos/2007#album'></category></entry>"; | |
URL=`curl -s --request POST --data "$MESSAGE" \ | |
--header "GData-Version: 2" --header "Content-Type: application/atom+xml" \ | |
-H "Authorization: Bearer $ACCESS_TOKEN" "https://picasaweb.google.com/data/feed/api/user/default"` | |
echo $URL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment