Skip to content

Commit

Permalink
[Units] Improve request parameter coherence in search_wiki function
Browse files Browse the repository at this point in the history
Improve request parameter order and documentation in search_wiki function
  • Loading branch information
Harmon758 committed Jul 26, 2023
1 parent e1fe99b commit a2da29e
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions units/wikis.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,26 @@ async def search_wiki(
):
raise ValueError("Page not found")

# https://www.mediawiki.org/wiki/API:Query
# https://www.mediawiki.org/wiki/API:Siteinfo
async with aiohttp_session.get(
api_url, params = {
"action": "query", "redirects": "",
"prop": "info|extracts|pageimages|revisions", "titles": search,
"inprop": "url", "exintro": "", "explaintext": "",
"pithumbsize": 9000, "pilicense": "any", "rvprop": "content",
"meta": "siteinfo", "format": "json"
# https://www.mediawiki.org/wiki/API:Query
"action": "query",
"prop": "info|extracts|pageimages|revisions",
"titles": search,
"redirects": "",
# https://www.mediawiki.org/wiki/API:Info
"inprop": "url",
# https://www.mediawiki.org/wiki/Extension:TextExtracts
"exintro": "",
"explaintext": "",
# https://www.mediawiki.org/wiki/Extension:PageImages
"pithumbsize": 9000,
"pilicense": "any",
# https://www.mediawiki.org/wiki/API:Revisions
"rvprop": "content",
# https://www.mediawiki.org/wiki/API:Siteinfo
"meta": "siteinfo",
"format": "json"
}
# TODO: Use exchars?
# TODO: Use images prop?
Expand Down

0 comments on commit a2da29e

Please sign in to comment.