Refactor HTTP common code (#207)

- move to common/http.py,
- make fetch_url return a Response.
This commit is contained in:
Marc Wrobel
2023-12-02 22:52:12 +01:00
committed by GitHub
parent aa3d15a3b5
commit 7cf62c2355
36 changed files with 138 additions and 113 deletions

View File

@@ -1,12 +1,13 @@
import mwparserfromhell
import re
from common import http
from common import endoflife
URL = "https://www.unrealircd.org/docwiki/index.php?title=History_of_UnrealIRCd_releases&action=raw"
print("::group::unrealircd")
response = endoflife.fetch_url(URL)
wikicode = mwparserfromhell.parse(response)
response = http.fetch_url(URL)
wikicode = mwparserfromhell.parse(response.text)
versions = {}
for tr in wikicode.ifilter_tags(matches=lambda node: node.tag == "tr"):