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 method for accessing url query string params #13

Open
chrismytton opened this issue Nov 14, 2016 · 1 comment
Open

Add method for accessing url query string params #13

chrismytton opened this issue Nov 14, 2016 · 1 comment

Comments

@chrismytton
Copy link
Contributor

Problem

Often in scrapers you need to pull information out of the querystring, which requires the following boilerplate code:

def query
  @query ||= URI.decode_www_form(URI.parse(url).query).to_h
end

Proposed solution

It would be good to offer some equivalent of the above code for the common case where we want to pull information out of the query string.

@chrismytton
Copy link
Contributor Author

As @tmtmtmtm mentioned in everypolitician-scrapers/spain_congreso_es#14 (comment) perhaps query_string would be a better name for this.

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

No branches or pull requests

1 participant