From 54fbfbac40434d14307aa29f763ced57f380419b Mon Sep 17 00:00:00 2001 From: Hails Date: Fri, 10 Nov 2023 10:19:15 -0500 Subject: [PATCH] fix meeting time As of 11/10/2023, the Chicago API is returning meeting times that are 5hrs after when the meeting actually happens. Made an adjustment to the meeting time for now until the API is fixed. --- city_scrapers/spiders/chi_citycouncil.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/city_scrapers/spiders/chi_citycouncil.py b/city_scrapers/spiders/chi_citycouncil.py index 6a6f533d1..66bd8fd45 100644 --- a/city_scrapers/spiders/chi_citycouncil.py +++ b/city_scrapers/spiders/chi_citycouncil.py @@ -51,8 +51,14 @@ def _parse_start(self, item): date = full_date.split("T")[0] time = full_date.split("T")[1] - time2 = time.split("+")[0] - return parser().parse(date + " " + time2) + time = time.split("+")[0] + + # as of 11/10/2023 the returned time is 5 hrs ahead of actual meeting time + + adjusted_hour = int(time.split(":")[0]) - 5 + adjusted_time = str(adjusted_hour) + ":" + time.split(":", 1)[1] + # print(adjusted_time) + return parser().parse(date + " " + adjusted_time) def _parse_end(self, item): """Parse end datetime as a naive datetime object. Added by pipeline if None""" @@ -85,7 +91,7 @@ def _parse_links(self, item): # list of dicts, where each dict is a meeting document for i in item["files"]: # now have a single dict - print(i) + # print(i) try: if i.get("attachmentType") == "Agenda": agenda_link = i.get("path")