Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement