rfeedreader 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/lib/rfeedreader.rb +15 -8
- data/lib/rfeedreader/version.rb +1 -1
- data/website/index.html +1 -1
- metadata +1 -1
data/History.txt
CHANGED
data/lib/rfeedreader.rb
CHANGED
@@ -102,12 +102,13 @@ module Rfeedreader
|
|
102
102
|
end
|
103
103
|
|
104
104
|
class Feed
|
105
|
-
attr_accessor :title, :link, :charset, :entries
|
105
|
+
attr_accessor :feed_url, :title, :link, :charset, :entries
|
106
106
|
|
107
107
|
def initialize(link, hpricot_doc)
|
108
|
-
@
|
108
|
+
@feed_url = link
|
109
109
|
puts "link: #{link}"
|
110
110
|
read_title hpricot_doc
|
111
|
+
read_link hpricot_doc
|
111
112
|
read_charset hpricot_doc
|
112
113
|
@entries = []
|
113
114
|
end
|
@@ -136,7 +137,7 @@ module Rfeedreader
|
|
136
137
|
end
|
137
138
|
|
138
139
|
def to_s
|
139
|
-
"Feed: title: #{title} - charset: #{charset}\n\rlink: #{link} - Entries: #{entries.size}"
|
140
|
+
"Feed #{feed_url}: title: #{title} - charset: #{charset}\n\rlink: #{link} - Entries: #{entries.size}"
|
140
141
|
end
|
141
142
|
|
142
143
|
def display_entries
|
@@ -159,13 +160,19 @@ module Rfeedreader
|
|
159
160
|
def read_title(hpricot_doc)
|
160
161
|
@title = (hpricot_doc/"//title:first").text
|
161
162
|
end
|
163
|
+
|
164
|
+
def read_link(hpricot_doc)
|
165
|
+
@link = (doc/"link").first.inner_text
|
166
|
+
@link = (doc/"link[@rel=alternate]").first[:href] if @link.empty?
|
167
|
+
@link = (doc/"link").first[:href] if @link.empty?
|
168
|
+
end
|
162
169
|
|
163
170
|
def source_type
|
164
|
-
return "source_flickr" if
|
165
|
-
return "source_fotolog" if
|
166
|
-
return "source_google_video" if
|
167
|
-
return "source_jumpcut" if
|
168
|
-
return "source_picasa" if
|
171
|
+
return "source_flickr" if @feed_url =~ /http:\/\/api\.flickr\.com/
|
172
|
+
return "source_fotolog" if @feed_url =~ /\.fotolog\.com/
|
173
|
+
return "source_google_video" if @feed_url =~ /http:\/\/video\.google\.com/
|
174
|
+
return "source_jumpcut" if @feed_url =~ /http:\/\/rss\.jumpcut\.com/
|
175
|
+
return "source_picasa" if @feed_url =~ /http:\/\/picasaweb\.google\.com/
|
169
176
|
return ""
|
170
177
|
end
|
171
178
|
end
|
data/lib/rfeedreader/version.rb
CHANGED
data/website/index.html
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
<h1>rfeedreader</h1>
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/rfeedreader"; return false'>
|
35
35
|
<p>Get Version</p>
|
36
|
-
<a href="http://rubyforge.org/projects/rfeedreader" class="numbers">0.9.
|
36
|
+
<a href="http://rubyforge.org/projects/rfeedreader" class="numbers">0.9.4</a>
|
37
37
|
</div>
|
38
38
|
<h2>What</h2>
|
39
39
|
|
metadata
CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: rfeedreader
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.9.
|
6
|
+
version: 0.9.4
|
7
7
|
date: 2007-09-03 00:00:00 +02:00
|
8
8
|
summary: Feed parser to read feed and return first posts of this feed. Special parsing from sources like Flickr, Jumcut, Google video, ...
|
9
9
|
require_paths:
|