feat: add scraping functionality for conferences and update routes #111
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#110
This pull request introduces a new feature for scraping conference details from a provided URL. The changes include adding a new endpoint, implementing the scraping logic, and updating the routes to support the feature.
API Enhancements:
scrape
action inApi::ConferencesController
to handle requests for scraping conference details from a URL. The action validates the presence of the URL, calls the scraper service, and returns the result or an error message. (app/controllers/api/conferences_controller.rb
, app/controllers/api/conferences_controller.rbR2-R20)Service Implementation:
ScraperService
in theConferenceScraper
module that usesNokogiri
andopen-uri
to scrape conference details (title, date, location) from the provided URL. The service includes basic error handling and customizable selectors for extracting data. (app/services/conference/scraper_service.rb
, app/services/conference/scraper_service.rbR1-R24)Route Updates:
POST /conferences/scrape
route to theconferences
resource for invoking the scrape functionality. (config/routes.rb
, config/routes.rbR22)