diff --git a/.gitignore b/.gitignore index f16fc4a..9358a47 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ config pep8.py .project .pydevproject +*.db +web diff --git a/plugins/drama.py b/plugins/drama.py index 7ad3631..1a84fda 100644 --- a/plugins/drama.py +++ b/plugins/drama.py @@ -3,8 +3,8 @@ article''' from util import hook, http -api_url = "http://encyclopediadramatica.com/api.php?action=opensearch" -ed_url = "http://encyclopediadramatica.com/" +api_url = "http://encyclopediadramatica.ch/api.php?action=opensearch" +ed_url = "http://encyclopediadramatica.ch/" @hook.command('ed') diff --git a/plugins/google.py b/plugins/google.py index caa9bb5..d6eaf4a 100644 --- a/plugins/google.py +++ b/plugins/google.py @@ -37,8 +37,8 @@ def google(inp): result = parsed['responseData']['results'][0] - title = result['titleNoFormatting'] - content = result['content'] + title = http.unescape(result['titleNoFormatting']) + content = http.unescape(result['content']) if len(content) == 0: content = "No description available" diff --git a/plugins/util/http.py b/plugins/util/http.py index 01b877f..888c102 100644 --- a/plugins/util/http.py +++ b/plugins/util/http.py @@ -88,3 +88,9 @@ def to_utf8(s): def quote_plus(s): return _quote_plus(to_utf8(s)) + + +def unescape(s): + if not s.strip(): + return s + return html.fromstring(s).text_content()