Class: NistBib::Scrapper
- Inherits:
-
Object
- Object
- NistBib::Scrapper
- Defined in:
- lib/nistbib/scrapper.rb
Constant Summary collapse
- DOMAIN =
"https://csrc.nist.gov".freeze
Class Method Summary collapse
-
.parse_page(hit_data) ⇒ Hash
Parse page.
Class Method Details
.parse_page(hit_data) ⇒ Hash
Parse page. rubocop:disable Metrics/AbcSize, Metrics/MethodLength
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/nistbib/scrapper.rb', line 12 def parse_page(hit_data) doc = get_page hit_data[:url] NistBibliographicItem.new( fetched: Date.today.to_s, type: "standard", # id: fetch_id(doc), titles: fetch_titles(hit_data), link: fetch_link(doc), docid: fetch_docid(doc), dates: fetch_dates(doc, hit_data[:release_date]), contributors: fetch_contributors(doc), edition: fetch_edition(hit_data[:code]), language: ["en"], script: ["Latn"], abstract: fetch_abstract(doc), docstatus: fetch_status(doc, hit_data[:status]), copyright: fetch_copyright(doc), relations: fetch_relations(doc), series: fetch_series(doc), keyword: fetch_keywords(doc), commentperiod: fetch_commentperiod(doc), ) end |