Skip to content

Instantly share code, notes, and snippets.

@takuya
Last active September 26, 2016 19:22
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 takuya/4a708697e489775ba791 to your computer and use it in GitHub Desktop.
Save takuya/4a708697e489775ba791 to your computer and use it in GitHub Desktop.
token=4e5d94xxxxxxxxxxxxx
gyazo( )
{
echo curl -s \
https://upload.gyazo.com/api/upload \
-F access_token=$token \
-F "imagedata=@$i"
exit
url=$( \
curl -s \
https://upload.gyazo.com/api/upload?access_token=$token \
-F "imagedata=@$i" \
| /usr/bin/ruby \
-e 'puts JSON.load($stdin.read)["permalink_url"]' \
-r json \
)
echo $url
# $url
return 0
}
for i in "$@";
do
gyazo $i;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment