Class: DoctorScrape::Scraper::Meta

Inherits:
Base
  • Object
show all
Defined in:
lib/doctor_scrape/scraper/meta.rb

Overview

This class uses the meta tags from the HTML document to get the content

Direct Known Subclasses

Diva

Instance Attribute Summary

Attributes inherited from Base

#data, #errors

Instance Method Summary collapse

Methods inherited from Base

#doc, #errors?, #fetch, #initialize, #scrape, #url

Constructor Details

This class inherits a constructor from DoctorScrape::Scraper::Base

Instance Method Details

#parseObject



7
8
9
10
11
12
13
14
# File 'lib/doctor_scrape/scraper/meta.rb', line 7

def parse
  @data.title     = text "DC.title"
  @data.author    = text "DC.creator"
  @data.issued    = text "DCTERMS.issued"
  @data.permalink = doc.xpath("//meta[@scheme='DCTERMS.URI']/@content").text
  @data.pdf       = pdf_from_meta || pdf_from_link
  @data.abstract  = abstract
end