Skip to content

Scrape events with invalid InSite URLs if they appear in the web calendar - #50

Merged
hancush merged 9 commits into
mainfrom
hcg/insite-patch
Jul 10, 2025
Merged

Scrape events with invalid InSite URLs if they appear in the web calendar#50
hancush merged 9 commits into
mainfrom
hcg/insite-patch

Conversation

@hancush

@hancush hancush commented Jul 9, 2025

Copy link
Copy Markdown
Collaborator

Overview

See title.

Closes #49
Connects opencivicdata/python-legistar-scraper#129

Notes

Optional. Ancillary topics, caveats, alternative strategies that didn't work out, anything else.

Testing Instructions

  • Manually run against staging site.

@hancush
hancush requested a review from antidipyramid July 9, 2025 20:46
Comment thread lametro/base.py Outdated
LOGGER = logging.getLogger(__name__)


class LAMetroAPIWebEventScraper(WebCalendarMixin, LegistarAPIEventScraper, Scraper):

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're using this in the root scraper and the paired event stream, I broke it out into its own class.

Comment thread lametro/base.py
Comment on lines +31 to +32
def _not_in_web_interface(self, api_event):
return api_event["EventBodyName"] == "OCEO Draft Review"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is always a private meeting.

Comment on lines +54 to +58
def LAMetroWebEvent(event_dict):
if "Meeting video" in event_dict:
return LAMetroWebEventDetail(event_dict)
else:
return LAMetroWebCalendarEvent(event_dict)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are slight differences between the event detail dict and the calendar listing dict. Use a factory to return the right dict subclass.

@hancush
hancush merged commit 5451a25 into main Jul 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scrape events with invalid InSite URLs if they're visible on the web calendar

1 participant