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

🏗️ Build mixin + spiders: bisnd_mc #8

Merged
merged 5 commits into from
Mar 20, 2024
Merged

🏗️ Build mixin + spiders: bisnd_mc #8

merged 5 commits into from
Mar 20, 2024

Conversation

SimmonsRitchie
Copy link
Contributor

@SimmonsRitchie SimmonsRitchie commented Mar 12, 2024

What's this PR do?

Adds a mixin and spiders to scrape multiple commission/boards from the website of the City of Mandan in Mandan, ND. The mixin that handles the core scraping logic is called bisnd_mc.

Why are we doing this?

Requested by our site partners.

Steps to manually test

  1. Ensure the project is installed:
pipenv sync --dev
  1. Activate the virtual env and enter the pipenv shell:
pipenv shell
  1. Run the spiders:
scrapy list | grep 'bisnd_mc' | xargs -I {} scrapy crawl {} -O {}.csv
  1. Monitor the output and ensure no errors are raised.

  2. Inspect the CSVs to ensure the data looks valid. You can view the value in the "source" column of the rows to ensure the data matches.

Are there any smells or added technical debt to note?


@SimmonsRitchie SimmonsRitchie requested a review from a team March 12, 2024 16:23
@SimmonsRitchie SimmonsRitchie marked this pull request as ready for review March 12, 2024 16:24

def start_requests(self):
"""
sdfsdfsdf

Choose a reason for hiding this comment

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

Dummy text?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. Now fixed!

# Calculate dates for one month prior and one year ahead
today = datetime.today()
one_month_prior = today - relativedelta(months=1)
one_year_ahead = today + relativedelta(months=6)

Choose a reason for hiding this comment

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

Naming issue one_year_ahead vs. half_year_ahead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. Now fixed!

links.append(
{
"title": file["name"],
"href": f"https://mandannd.api.civicclerk.com/v1/Meetings/GetMeetingFileStream(fileId={file['fileId']},plainText=false)", # noqa

Choose a reason for hiding this comment

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

You can replace https://mandannd.api.civicclerk.com with {self.base_url}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. That's def tidier. Thanks, @LienDang.

Copy link

@LienDang LienDang left a comment

Choose a reason for hiding this comment

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

LGTM

@SimmonsRitchie SimmonsRitchie merged commit ea5c09b into main Mar 20, 2024
2 checks passed
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.

2 participants