Module: RelatonCen::Scrapper

Defined in:
lib/relaton_cen/scrapper.rb

Overview

Scrapper.

Constant Summary collapse

COMMITTEES =
{
  "TC 459" =>
    "ECISS - European Committee for Iron and Steel Standardization",
}.freeze

Class Method Summary collapse

Class Method Details

.parse_page(hit) ⇒ RelatonIsoBib::IsoBibliographicItem

Parse page.

Parameters:

Returns:

  • (RelatonIsoBib::IsoBibliographicItem)


15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/relaton_cen/scrapper.rb', line 15

def parse_page(hit) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
  doc = hit.hit_collection.agent.get hit.hit[:url]
  BibliographicItem.new(
    fetched: Date.today.to_s,
    type: "standard",
    docid: fetch_docid(hit.hit[:code]),
    language: ["en"],
    script: ["Latn"],
    title: fetch_titles(doc),
    doctype: RelatonBib::DocumentType.new(type: "international-standard"),
    docstatus: fetch_status(doc),
    ics: fetch_ics(doc),
    date: fetch_dates(doc),
    # contributor: fetch_contributors(doc),
    editorialgroup: fetch_editorialgroup(doc),
    structuredidentifier: fetch_structuredid(hit.hit),
    abstract: fetch_abstract(doc),
    copyright: fetch_copyright(doc),
    link: fetch_link(doc.uri.to_s),
    relation: fetch_relations(doc),
    place: ["London"],
  )
end