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

Fix source fetching #77

Merged
merged 6 commits into from
Mar 27, 2019
Merged

Fix source fetching #77

merged 6 commits into from
Mar 27, 2019

Conversation

chrismytton
Copy link
Member

The parliament website has been updated so we need to update the scraper for retrieving sources. Luckily the new page uses AJAX calls to a JSON API, so we can get the data we need directly from the JSON rather than scraping HTML. This has drastically simplified the source fetching script, and I've taken the opportunity to clean things up a bit while I was in there.

Part of mysociety/pombola#2458

It's easier to see what's gone wrong if you can see a stacktrack.

This also means that if the management command fails in this method then
it will exit with a non-zero status, which will trigger cron error
emails which we want.
- Remove commented code that doesn't seem useful
- Remove useless comment
Newer documents use a UUID as their document number, aka ID, so switch
this field to be a char so we can store everything.
There is now a JSON feed of sources, so we can drastically simplify this
code and remove a few options while we're at it.
@mysociety-pusher mysociety-pusher merged commit 896372e into master Mar 27, 2019
@chrismytton chrismytton deleted the fix-source-fetching branch June 20, 2019 11:20
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