Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create EventsCalendarSpider subclass #17

Merged
2 commits merged into from
Aug 17, 2022
Merged

create EventsCalendarSpider subclass #17

2 commits merged into from
Aug 17, 2022

Conversation

rhetr
Copy link
Collaborator

@rhetr rhetr commented Aug 13, 2022

PR for #16.

from the class comment:

    Subclass of CityScrapersSpider that may be useful
    for WordPress sites with the Events Calendar plugin.
    Three additional things need to be implemented when subclassing:
        1. a categories dict
        2. _parse_location(self, item):
        3. _parse_links(self, item)
    where `item` is the dict retrieved from the API.

    categories dict should be of the following format:
    categories = {
        CLASSIFICATION: ["category-1", "category-2"],
        ..
    }

example usage:

from city_scrapers_core.spiders import EventsCalendarSpider

class AtlBeltlineSpider(EventsCalendarSpider):
    name = "atl_beltline"
    state = "GA"
    agency = "Atlanta BeltLine Inc."
    timezone = "America/New_York"
    start_urls = ["https://beltline.org/wp-json/tribe/events/v1/events"]
    categories = {
        BOARD: [
            "abi-board-meetings",
            "abi-execeutive-committee-meetings",
            "leadership",
        ],
        FORUM: [
            "community-meetings",
            "economic-development",
            "housing",
            "bahab-meetings",
        ],
        ADVISORY_COMMITTEE: ["design-review-committee"],
    }

    def _parse_location(self, item):
        ...

    def _parse_links(self, item):
        ...

@ghost ghost merged commit f4a8518 into main Aug 17, 2022
@rhetr rhetr deleted the 0016-spider-eventscalendar branch August 24, 2022 22:59
This pull request was closed.
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.

1 participant