Skip to content

Instantly share code, notes, and snippets.

@JustDevZero
Created December 20, 2011 00:58
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 JustDevZero/1499698 to your computer and use it in GitHub Desktop.
Save JustDevZero/1499698 to your computer and use it in GitHub Desktop.
Nautilus-script for uploading into tumblr
#!/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