From 0160d86a64eebfc2d45edfbeceb3eef11cd4fb9f Mon Sep 17 00:00:00 2001 From: Nathan Blaney Date: Mon, 5 Aug 2013 19:32:53 +1000 Subject: [PATCH] Create QR code plugin --- plugins/qr.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 plugins/qr.py diff --git a/plugins/qr.py b/plugins/qr.py new file mode 100644 index 0000000..1502000 --- /dev/null +++ b/plugins/qr.py @@ -0,0 +1,15 @@ +# Plugin by https://github.com/Mu5tank05 +from util import hook, web, http + + +@hook.command('qr') +@hook.command +def qrcode(inp, bot=None): + "qrcode [link] returns a link for a QR code." + + link = "http://blny.tk/qr.php?q=%s" % http.quote_plus(inp) + + try: + return web.isgd(link) + except (web.ShortenError, http.HTTPError): + return link