Skip to content

Instantly share code, notes, and snippets.

@saterus
Created February 19, 2019 16:55
Show Gist options
  • Save saterus/4aa57a29cf8e1e363f96d8c1262b7b20 to your computer and use it in GitHub Desktop.
Save saterus/4aa57a29cf8e1e363f96d8c1262b7b20 to your computer and use it in GitHub Desktop.
function giphy
set filename "$argv[1]"
set full_path "$HOME/Downloads/$filename"
if test -n "$argv[2]"
set url "$argv[2]"
else
set url (pbpaste)
end
curl \
# --verbose \
--silent \
-H "Content-Type: image/gif" \
-H "Accept: image/gif" \
-o "$full_path" \
--url "$url"
if test $status -eq 0
echo "Saved $full_path"
else
echo "Something went wrong! $status"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment