Created
September 19, 2013 22:37
-
-
Save initbrain/6630822 to your computer and use it in GitHub Desktop.
XChat Script (IRC client) - Make an "Let me Google That For You" url and send it to current channel
This file contains 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
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
import xchat, urllib | |
__module_name__ = "pyLmgtfy" | |
__module_version__ = "0.1" | |
__module_description__ = "Make an \"Let me Google That For You\" url and send it to current channel" | |
__module_author__ = "initbrain" | |
def onLmgtfy(word, word_eol, userdata): | |
if len(word) < 2: | |
print "Usage: /lmgtfy <google search>" | |
else: | |
# make the url | |
lmgtfy="http://lmgtfy.com/?q="+urllib.quote((' ').join(word[1:])); | |
# display | |
xchat.command("MSG " + xchat.get_info("channel") + " " + lmgtfy) | |
return xchat.EAT_ALL | |
xchat.hook_command("lmgtfy", onLmgtfy, help="/lmgtfy <google search>") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment