Created
December 20, 2011 00:58
-
-
Save JustDevZero/1499698 to your computer and use it in GitHub Desktop.
Nautilus-script for uploading into tumblr
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/sh | |
# | |
# What to Write | |
# | |
# <info at danielripoll.es> | |
# Daniel Ripoll | |
# http://www.danielripoll.es | |
# http://ociolinux.blogspot.com/ | |
# Licensed under GPL3+ | |
TMB_TYPE='photo'; | |
TMB_CONFIG="$HOME/.tumblracc" | |
if [ -f "$TMB_CONFIG" ]; then | |
TMB_USER=`head -n1 "$TMB_CONFIG"` | |
TMB_PASS=`tail -n1 "$TMB_CONFIG"` | |
else | |
TMB_USER=`zenity --title "Login into tumblr" --entry --text "Please, enter your tumblr email."` | |
TMB_PASS=`zenity --title "Login into tumblr" --entry --text "Please, enter your tumblr password." --hide-text` | |
echo "$TMB_USER" > "$TMB_CONFIG" | |
echo "$TMB_PASS" >> "$TMB_CONFIG" | |
chmod 700 "$TMB_CONFIG" | |
fi | |
# | |
# Updating | |
# | |
for TMB_FILE in "$@" | |
do | |
curl -F "email=$TMB_USER" -F "password=$TMB_PASS" -F "type=photo" -F "data=@$TMB_FILE" https://www.tumblr.com/api/write | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment