update wikipedia.py to use Response.json()
This commit is contained in:
parent
f97cf60434
commit
c3ce47b19d
1 changed files with 2 additions and 2 deletions
|
@ -17,9 +17,9 @@ class Module(ModuleManager.BaseModule):
|
||||||
"action": "query", "prop": "extracts",
|
"action": "query", "prop": "extracts",
|
||||||
"titles": event["args"], "exintro": "",
|
"titles": event["args"], "exintro": "",
|
||||||
"explaintext": "", "exchars": "500",
|
"explaintext": "", "exchars": "500",
|
||||||
"redirects": "", "format": "json"}, json=True)
|
"redirects": "", "format": "json"}).json()
|
||||||
if page:
|
if page:
|
||||||
pages = page.data["query"]["pages"]
|
pages = page["query"]["pages"]
|
||||||
article = list(pages.items())[0][1]
|
article = list(pages.items())[0][1]
|
||||||
if not "missing" in article:
|
if not "missing" in article:
|
||||||
title, info = article["title"], article["extract"]
|
title, info = article["title"], article["extract"]
|
||||||
|
|
Loading…
Reference in a new issue