made qr.py use the google API directly, also did a neat thing with a dictionary

This commit is contained in:
Luke Rogers 2013-09-04 20:14:14 +12:00
parent 488d00e758
commit 8769b97dc0

View file

@ -7,7 +7,13 @@ from util import hook, web, http
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)
args = {
"cht": "qr", # chart type
"chs": "200x200", # dimensions
"chl": inp
}
link = http.prepare_url("http://chart.googleapis.com/chart", args)
return web.try_isgd(link)