Class: LinkOracle::Extractor::OG
- Inherits:
-
Base
- Object
- Base
- LinkOracle::Extractor::OG
show all
- Defined in:
- lib/link_oracle/extractor/og.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
|
# File 'lib/link_oracle/extractor/og.rb', line 17
def description
get_content("//meta[@property='og:description']")
end
|
#image ⇒ Object
12
13
14
15
|
# File 'lib/link_oracle/extractor/og.rb', line 12
def image
return image_data if !image_data.first
image_is_path? ? [] : image_data
end
|
#image_data ⇒ Object
25
26
27
|
# File 'lib/link_oracle/extractor/og.rb', line 25
def image_data
get_content("//meta[@property='og:image']")
end
|
#image_is_path? ⇒ Boolean
21
22
23
|
# File 'lib/link_oracle/extractor/og.rb', line 21
def image_is_path?
!!(image_data.first.match(/\A\//))
end
|
#title ⇒ Object
8
9
10
|
# File 'lib/link_oracle/extractor/og.rb', line 8
def title
get_content("//meta[@property='og:title']")
end
|
#type ⇒ Object
4
5
6
|
# File 'lib/link_oracle/extractor/og.rb', line 4
def type
:og
end
|