Class: LinkOracle::Extractor::Meta
- Inherits:
-
Base
- Object
- Base
- LinkOracle::Extractor::Meta
show all
- Defined in:
- lib/link_oracle/extractor/meta.rb
Instance Attribute Summary
Attributes inherited from Base
#link_data, #parsed_body, #url
Instance Method Summary
collapse
Methods inherited from Base
#get_content, #initialize, #perform
Instance Method Details
#description ⇒ Object
17
18
19
20
21
22
23
|
# File 'lib/link_oracle/extractor/meta.rb', line 17
def description
get_content("//meta[translate(
@name,
'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
'abcdefghijklmnopqrstuvwxyz'
) = 'description']")
end
|
#image ⇒ Object
13
14
15
|
# File 'lib/link_oracle/extractor/meta.rb', line 13
def image
get_content("//meta[contains(@name, 'thumbnail')]")
end
|
#title ⇒ Object
8
9
10
11
|
# File 'lib/link_oracle/extractor/meta.rb', line 8
def title
found = parsed_body.at_xpath("//title/text()")
found ? [found.content] : []
end
|
#type ⇒ Object
4
5
6
|
# File 'lib/link_oracle/extractor/meta.rb', line 4
def type
:meta
end
|