Module: Relaton::Cen::Scraper

Defined in:
lib/relaton/cen/scraper.rb

Overview

Scraper.

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:

  • hit (RelatonCen::Hit)

Returns:

  • (RelatonIsoBib::IsoBibliographicItem)


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

def parse_page(hit) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
  doc = hit.hit_collection.agent.get hit.hit[:url]
  ItemData.new(
    fetched: Date.today.to_s,
    type: "standard",
    docidentifier: fetch_docid(hit.hit[:code]),
    language: ["en"],
    script: ["Latn"],
    title: fetch_titles(doc),
    status: fetch_status(doc),
    date: fetch_dates(doc),
    contributor: fetch_contributors(doc),
    # editorialgroup: fetch_editorialgroup(doc),
    abstract: fetch_abstract(doc),
    copyright: fetch_copyright(doc),
    source: fetch_source(doc.uri.to_s),
    relation: fetch_relations(doc),
    place: [Bib::Place.new(city: "London")],
    ext: fetch_ext(doc, hit)
  )
end