Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 27 lines (19 sloc) 914 Bytes
#!/bin/sh
email="$1"
pass="$2"
# use a different photo booth directory depending on version of OSX
vers=`sw_vers | grep "ProductVersion" | cut -d : -f 2 | cut -d "." -f 2`
if [ "$vers" = "6" ]; then
path="$HOME/Pictures/Photo Booth"
elif [ "$vers" = "5" ]; then
path="$HOME/Pictures/Photo Booth"
else
path="$HOME/Pictures/Photo Booth Library/Pictures"
fi
cd "$path"
old=$(ls -t | head -1)
new=$(date +%d).jpg
mv "$old" "$new"
entity=`curl -L -s -c cookie -d email=$email -d password=$pass -d rememberme=0 -d process=1 -d submit=1 -d redirect=0 https://www.movember.com/us/auth/do-login | grep 'http://mobro.co/' | tail -n 1 | awk {'print $2'} | sed "s,'http://mobro.co/,," | sed "s/',//"`
curl -s -b cookie http://us.movember.com/mospace/your-donation-page/create-post/ -F content=$new -F entity_id=$entity -F name=image -F "filename=$new;image/jpeg;" -F "image=@$new"
rm -rf cookie