AyOK-Code / oscn_scraper

MIT License
1 stars 1 forks source link

Ability to send back JSON in a single class method class #7

Open holdenmitchell opened 2 years ago

holdenmitchell commented 2 years ago

Description

Currently both the Parser and the Requestor need to be called in order to return JSON. It would be nice to have a method or optional argument on the requestors that allows you to send the request, parse the data and returns JSON. This would prevent code like this:

html = OscnScraper::Requestor::Case.new({ county: county, number: case_number }).fetch_case_by_number
data = OscnScraper::Parsers::CaseLinks.perform(html)

It is important to still allow for returning html though, since the html is saved in the database. However, I think that the default should return JSON.