From f04c01beb7a690d8c06c49eb1274266603ba0203 Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Thu, 7 Feb 2013 00:35:03 +1300 Subject: [PATCH] Fixed mcwiki help string. --- plugins/mcwiki.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/mcwiki.py b/plugins/mcwiki.py index db7843e..fe9aaea 100755 --- a/plugins/mcwiki.py +++ b/plugins/mcwiki.py @@ -2,21 +2,21 @@ from util import hook, http, text import re api_url = "http://minecraftwiki.net/api.php?action=opensearch" -ed_url = "http://minecraftwiki.net/wiki/" +mc_url = "http://minecraftwiki.net/wiki/" @hook.command def mcwiki(inp): - "drama -- Gets the first paragraph of" \ + "mcwiki -- Gets the first paragraph of" \ " the Minecraft Wiki article on ." j = http.get_json(api_url, search=inp) - print j + if not j[1]: return "No results found." article_name = j[1][0].replace(' ', '_').encode('utf8') - url = ed_url + http.quote(article_name, '') + url = mc_url + http.quote(article_name, '') page = http.get_html(url) for p in page.xpath('//div[@class="mw-content-ltr"]/p'):