From 1677f3986df69b5600c5986f31534af2fa693ea3 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Sun, 9 Mar 2025 10:51:04 +0100 Subject: refactor: make URL query params more readable --- proposals.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'proposals.py') diff --git a/proposals.py b/proposals.py index 35a7f38..ae6a451 100755 --- a/proposals.py +++ b/proposals.py @@ -14,7 +14,13 @@ osmwiki = pywikiapi.Site(OSMWIKI_ENDPOINT) # https://wiki.openstreetmap.org/w/index.php?title=Template:Proposal_page&action=edit res = requests.get( - 'https://wiki.openstreetmap.org/w/api.php?action=expandtemplates&prop=wikitext&format=json&text={%7B%23invoke:languages/table%7Cjson}}' + OSMWIKI_ENDPOINT, + params=dict( + action='expandtemplates', + prop='wikitext', + format='json', + text='{{#invoke:languages/table|json}}', + ), ) langs = json.loads(res.json()['expandtemplates']['wikitext']) -- cgit v1.2.3