Skip to content

Instantly share code, notes, and snippets.

@ohhdemgirls
Created March 28, 2015 20:02
Show Gist options
  • Save ohhdemgirls/42a4d4129a14c5b6cab4 to your computer and use it in GitHub Desktop.
Save ohhdemgirls/42a4d4129a14c5b6cab4 to your computer and use it in GitHub Desktop.
#!/bin/bash
#Usage: ./imgrush.sh $(cat cats.txt)
echo -e "\e[91mImgrush all the cats!!!\e[0m"
for f in "$@"; do
echo -ne "\e[34mUploading:\e[0m" $f
url="https://imgrush.com/api/upload/url"
out=$(curl -s -F "url=$f" "$url")
hash=$(echo $out |sed -nre 's#.*"hash": "([^"]+)".*#\1#p')
if [[ $images == "" ]];then images="$hash";else images="$images,$hash";fi
echo -e "\r\033[K\e[92mUploaded:\e[0m" https://imgrush.com/$hash;done
echo;echo -e "\e[34mAdding catss to album...\e[0m"
out=$(curl -s -F "list=$images" "https://imgrush.com/api/album/create")
hash=$(echo $out |sed -nre 's#.*"hash": "([^"]+)".*#\1#p')
clear;echo -e "\e[92mSuccessfully made a huge cat album!:\e[0m" https://imgrush.com/$hash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment