Created
February 4, 2015 01:50
-
-
Save girvan/51daa6dea84f41e29042 to your computer and use it in GitHub Desktop.
tinypng api
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
tinypng() { | |
for f in *.png | |
do | |
cmd="curl -s --user api:YOUR_API_KEY --data-binary @$f https://api.tinypng.com/shrink | sed 's/.*https/https/g' | sed 's/\.png.*/.png/g' | xargs curl -s -o $f" | |
eval "$cmd"; | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment