Skip to content

Commit

Permalink
fix meeting time
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
haileyhoyat authored Nov 10, 2023
1 parent 2f3edf6 commit 54fbfba
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions city_scrapers/spiders/chi_citycouncil.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 54fbfba

Please sign in to comment.