Skip to content

Commit

Permalink
added giphy plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
aziz committed May 6, 2018
1 parent 50c0925 commit e6b8054
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bash/plugins/giphy.plugin.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash


function giphy {
tag="$(echo "$*" | sed 's/ /+/')"
random_api_url="http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=$tag"
gif_url="$(curl "$random_api_url" 2> /dev/null | jq '.data.image_url' -r)"
echo $gif_url
curl "$gif_url" 2> /dev/null | imgcat
}


0 comments on commit e6b8054

Please sign in to comment.