fix: Stray HTML tag is no longer in the API response?
This commit is contained in:
parent
c105428ec5
commit
6b857f1675
1 changed files with 4 additions and 6 deletions
|
@ -13,9 +13,7 @@ OFFSET = -time.timezone
|
||||||
events_url = "https://bitlair.nl/Special:Ask/-5B-5BCategory:Event-5D-5D-20-5B-5BStart::%E2%89%A519-20January-202023-5D-5D/-3FStart/-3FEnd/-3FEvent-20location/mainlabel%3D/limit%3D50/order%3DASC/sort%3DStart/prettyprint%3Dtrue/format%3Djson"
|
events_url = "https://bitlair.nl/Special:Ask/-5B-5BCategory:Event-5D-5D-20-5B-5BStart::%E2%89%A519-20January-202023-5D-5D/-3FStart/-3FEnd/-3FEvent-20location/mainlabel%3D/limit%3D50/order%3DASC/sort%3DStart/prettyprint%3Dtrue/format%3Djson"
|
||||||
# above URL asks for all events and returns their name, start, end and location
|
# above URL asks for all events and returns their name, start, end and location
|
||||||
events_page = requests.get(events_url)
|
events_page = requests.get(events_url)
|
||||||
# remove first line from output because the first line is '<script src='/vendor/composer/installed.js'></script>'
|
events = events_page.json()
|
||||||
# which is not valid JSON, believe it or not
|
|
||||||
events = json.loads(''.join(events_page.text.splitlines(keepends=True)[1:]))
|
|
||||||
|
|
||||||
cal = icalendar.Calendar()
|
cal = icalendar.Calendar()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue