Skip to content

Commit

Permalink
IN: fix import duplicates by using unique meeting link as dedupe key
Browse files Browse the repository at this point in the history
  • Loading branch information
jessemortenson committed Nov 21, 2024
1 parent d0cfefe commit 51f84c4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scrapers/in/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def scrape(self):

date_str = meeting["meetingdate"].replace(" ", "")
time_str = meeting["starttime"]
custom_start_string = ""
# Determine the 'when' variable based on the presence of time
if time_str:
time_str = time_str.replace(
Expand All @@ -68,21 +69,22 @@ def scrape(self):
else:
when = dateutil.parser.parse(date_str).date()
all_day = True
if "customstart" in meeting and meeting['customstart'] != "":
custom_start_string = f" - {meeting['customstart']}"

location = meeting["location"] or "See Agenda"
video_url = (
f"https://iga.in.gov/legislative/{self.session}/meeting/watchlive/{_id}"
)
event_name = f"{committee['chamber']}#{committee_name}#{location}#{when}"

event = Event(
name=committee_name,
name=f"{committee_name}{custom_start_string}",
start_date=when,
all_day=all_day,
location_name=location,
classification="committee-meeting",
)
event.dedupe_key = event_name
event.dedupe_key = meeting["link"]
event.add_source(link, note="API details")
name_slug = re.sub("[^a-zA-Z0-9]+", "-", committee_name.lower())

Expand Down

0 comments on commit 51f84c4

Please sign in to comment.