Skip to content

Commit

Permalink
Merge pull request #5000 from braykuka/sd-add-room-to-location
Browse files Browse the repository at this point in the history
SD: Add room to location
  • Loading branch information
NewAgeAirbender authored Aug 6, 2024
2 parents ea99b54 + 174b0b8 commit 220ba0e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions scrapers/sd/events.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from openstates.scrape import Scraper, Event
import re
import pytz
import lxml
import scrapelib
import dateutil.parser

from openstates.scrape import Scraper, Event


class SDEventScraper(Scraper):
# chambers = {"lower": "House", "upper": "Senate", "joint": "Joint"}
Expand All @@ -26,7 +28,8 @@ def scrape_schedule_file(self):
com_name = row["InterimYearCommitteeName"]

com = {"FullName": com_name}
event = self.create_event(com, row)
location = row["Room"]
event = self.create_event(com, row, location)

self.scrape_agendas_and_bills(event, row["DocumentId"])

Expand Down Expand Up @@ -179,12 +182,16 @@ def scrape(self):
for key in events_by_date:
yield events_by_date[key]

def create_event(self, committee, agenda_document):
def create_event(self, committee, agenda_document, location=""):
name = committee["FullName"]

start_date = dateutil.parser.parse(agenda_document["DocumentDate"])

location = "500 E Capitol Ave, Pierre, SD 57501"
base_loc = "500 E Capitol Ave, Pierre, SD 57501"
if location and re.match(r"Room \d+", location):
location = location + ", " + base_loc

location = location or base_loc

event = Event(
name=name,
Expand Down

0 comments on commit 220ba0e

Please sign in to comment.