Last active
December 21, 2016 10:25
-
-
Save x13machine/917ae8ddd765baa2bea98ccad5710c53 to your computer and use it in GitHub Desktop.
Urban Dictionary addon for Hexchat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""" | |
Usage: /ud <word> | |
Creator: x13machine <https://github.com/x13machine> | |
License: WTFPL <http://www.wtfpl.net/> | |
"""" | |
__module_name__ = "Urban Dictionary" | |
__module_version__ = "1.0" | |
__module_description__ = "Gets the Urban Dictionary" | |
import hexchat | |
import requests | |
def ud(word, word_eol, userdata): | |
try: | |
r = requests.get('http://api.urbandictionary.com/v0/define', params={'term':word_eol[1]}) | |
hexchat.prnt('Urban Dictionary: ' + r.json()['list'][0]['definition']) | |
except: | |
hexchat.prnt('Urban Dictionary: ENGLISH, MOTHERFUCKER DO YOU SPEAK IT???') | |
hexchat.hook_command('ud', ud, help='UD <word>') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment