This is a simple weechat plugin that inserts random giphy URLs based on a search.
/giphy SEARCH QUERY
Install requests:
$ pip install requests
Copy the script to ~/.weechat/python/autoload
mkdir -p ~/.weechat/python/autoload
wget https://raw.githubusercontent.com/keith/giphy-weechat/master/giphy.py ~/.weechat/python/autoload