From a2da29e0494e900c20c41150b256dfc11a60f914 Mon Sep 17 00:00:00 2001 From: Harmon Date: Wed, 26 Jul 2023 06:49:27 -0500 Subject: [PATCH] [Units] Improve request parameter coherence in search_wiki function Improve request parameter order and documentation in search_wiki function --- units/wikis.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/units/wikis.py b/units/wikis.py index 2f90c3ab24..2420ad6484 100644 --- a/units/wikis.py +++ b/units/wikis.py @@ -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?