Class: Omnom::Source::Feed
- Inherits:
-
Base
- Object
- Base
- Omnom::Source::Feed
show all
- Defined in:
- lib/omnom/source/feed.rb
Instance Attribute Summary
Attributes inherited from Base
#config, #feed_key, #key, #options, #settings, #source_id
Instance Method Summary
collapse
Methods inherited from Base
config, configure, cron, every, feed_url, full_key, guid_namespace, icon, icon_from_url, inherited, #initialize, key, required_config, required_options, #update, url
#html_to_text
Instance Method Details
#after_initialize ⇒ Object
7
8
9
|
# File 'lib/omnom/source/feed.rb', line 7
def after_initialize
@settings[:icon] = self.class.icon_from_url(@options[:url]) if @settings[:icon].blank?
end
|
#author_name ⇒ Object
48
49
50
|
# File 'lib/omnom/source/feed.rb', line 48
def author_name
@entry.author
end
|
#description ⇒ Object
32
33
34
|
# File 'lib/omnom/source/feed.rb', line 32
def description
@entry.summary || @entry.content
end
|
#get_raw_posts ⇒ Object
11
12
13
|
# File 'lib/omnom/source/feed.rb', line 11
def get_raw_posts
Feedzirra::Feed.fetch_and_parse(@options[:url]).entries
end
|
#guid ⇒ Object
36
37
38
|
# File 'lib/omnom/source/feed.rb', line 36
def guid
@entry.id
end
|
#post_attributes(entry) ⇒ Object
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/omnom/source/feed.rb', line 15
def post_attributes(entry)
@entry = entry
{
title: title,
description: description,
guid: guid,
url: url,
published_at: published_at,
author_name: author_name,
tags: tags
}
end
|
#published_at ⇒ Object
44
45
46
|
# File 'lib/omnom/source/feed.rb', line 44
def published_at
@entry.published
end
|
52
53
54
|
# File 'lib/omnom/source/feed.rb', line 52
def tags
@entry.categories
end
|
#title ⇒ Object
28
29
30
|
# File 'lib/omnom/source/feed.rb', line 28
def title
@entry.title
end
|
#url ⇒ Object
40
41
42
|
# File 'lib/omnom/source/feed.rb', line 40
def url
@entry.url
end
|