Class: Coelacanth::Extractor::MetadataProbe

Inherits:
Object
  • Object
show all
Defined in:
lib/coelacanth/extractor/metadata_probe.rb

Overview

Attempts to pull article metadata such as JSON-LD and OpenGraph tags.

Defined Under Namespace

Classes: Result

Constant Summary collapse

ARTICLE_TYPES =
%w[Article NewsArticle BlogPosting ReportageNewsArticle LiveBlogPosting].freeze

Instance Method Summary collapse

Instance Method Details

#call(doc:, url: nil) ⇒ Object



24
25
26
# File 'lib/coelacanth/extractor/metadata_probe.rb', line 24

def call(doc:, url: nil)
  from_jsonld(doc, url) || from_semantic_nodes(doc)
end