Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. function giphy
  2. set filename "$argv[1]"
  3. set full_path "$HOME/Downloads/$filename"
  4.  
  5. if test -n "$argv[2]"
  6. set url "$argv[2]"
  7. else
  8. set url (pbpaste)
  9. end
  10.  
  11. curl \
  12. # --verbose \
  13. --silent \
  14. -H "Content-Type: image/gif" \
  15. -H "Accept: image/gif" \
  16. -o "$full_path" \
  17. --url "$url"
  18.  
  19. if test $status -eq 0
  20. echo "Saved $full_path"
  21. else
  22. echo "Something went wrong! $status"
  23. end
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement