Module: DoctorScrape::Scraper
- Defined in:
- lib/doctor_scrape.rb,
lib/doctor_scrape/scraper/duo.rb,
lib/doctor_scrape/scraper/base.rb,
lib/doctor_scrape/scraper/bora.rb,
lib/doctor_scrape/scraper/diva.rb,
lib/doctor_scrape/scraper/meta.rb,
lib/doctor_scrape/scraper/unknown.rb
Defined Under Namespace
Classes: Base, Bora, Diva, Duo, Meta, Unknown
Class Method Summary collapse
-
.for(url) ⇒ Object
TODO: move this logic into the scraper classes.
Class Method Details
.for(url) ⇒ Object
TODO: move this logic into the scraper classes
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/doctor_scrape.rb', line 21 def self.for(url) case url when %r{^http://(www.)?duo.uio.no} then Duo.new url when %r{^https?://bora.hib.no} then Bora.new url when %r{^http://.+bibsys.no}, %r{idtjeneste.nb.no/URN:NBN:no-bibsys_brage} then Meta.new url when %r{^http://ntnu.diva-portal.org/smash/record.jsf}, %r{urn=urn:nbn:no:ntnu:diva} then Diva.new url else Unknown.new url end end |