update wikipedia.py to use Response.json()

This commit is contained in:
jesopo 2019-11-26 14:14:38 +00:00
parent f97cf60434
commit c3ce47b19d

View file

@ -17,9 +17,9 @@ class Module(ModuleManager.BaseModule):
"action": "query", "prop": "extracts",
"titles": event["args"], "exintro": "",
"explaintext": "", "exchars": "500",
"redirects": "", "format": "json"}, json=True)
"redirects": "", "format": "json"}).json()
if page:
pages = page.data["query"]["pages"]
pages = page["query"]["pages"]
article = list(pages.items())[0][1]
if not "missing" in article:
title, info = article["title"], article["extract"]