Skip to content

Instantly share code, notes, and snippets.

@Soulflare3
Forked from initbrain/xchat_lmgtfy.py
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Soulflare3/4ca640a4f9683ba5e83d to your computer and use it in GitHub Desktop.
Save Soulflare3/4ca640a4f9683ba5e83d to your computer and use it in GitHub Desktop.
#!/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