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

Add Rio de Janeiro/RJ spider #29

Merged
merged 10 commits into from
May 19, 2018
Merged

Conversation

brunolellis
Copy link
Contributor

@brunolellis brunolellis commented Apr 27, 2018

This PR creates a spider to crawl gazettes from Rio de Janeiro.

I don't know how to test all possible flows using scrapy contracts.

For example:

  1. no_gazette for weekends and holidays
  2. one_gazette when no extra edition is published
  3. multiple_gazettes for extra editions

I thought about creating 3 functions, one for each case, and write the contract inside each callback function, but it seems overkill, doesn't it?

PS: this PR depends on #28


return items

def create_gazette(self, date, url, is_extra_edition = False):
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a small remark: PEP8 recommends no spaces around = sign when indicating default paramater value.

Copy link
Contributor

@Irio Irio left a comment

Choose a reason for hiding this comment

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

Just opened an issue to discuss how we've been using Scrapy Contracts. In this case, considering our current patterns, we could just merge this branch without contracts.

Ready to be merged once #28 is on master (working locally).

@Irio Irio merged commit 07f5534 into okfn-brasil:master May 19, 2018
@alfakini alfakini mentioned this pull request May 24, 2018
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.

None yet

3 participants