rfeedreader 1.0.16 → 1.0.17
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 +19 -28
- data/lib/rfeedreader/version.rb +1 -1
- data/test/test_rfeedreader.rb +8 -0
- metadata +2 -2
data/History.txt
CHANGED
data/lib/rfeedreader.rb
CHANGED
@@ -125,27 +125,22 @@ module Rfeedreader
|
|
125
125
|
|
126
126
|
# Parse each item
|
127
127
|
(hpricot_doc/"item|entry")[0..nb_posts - 1].each do |item|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
@entries<<
|
144
|
-
when "source_youtube"
|
145
|
-
@entries<<Entry_Youtube.new(item, self.charset)
|
146
|
-
else
|
147
|
-
@entries<<Entry.new(item, self.charset)
|
148
|
-
end
|
128
|
+
|
129
|
+
case type
|
130
|
+
when "source_flickr"
|
131
|
+
@entries<<Entry_Flickr.new(item, self.charset)
|
132
|
+
when "source_fotolog"
|
133
|
+
@entries<<Entry_Fotolog.new(item, self.charset)
|
134
|
+
when "source_google_video"
|
135
|
+
@entries<<Entry_Google_Video.new(item, self.charset)
|
136
|
+
when "source_jumpcut"
|
137
|
+
@entries<<Entry_Jumpcut.new(item, self.charset)
|
138
|
+
when "source_picasa"
|
139
|
+
@entries<<Entry_Picasa.new(item, self.charset)
|
140
|
+
when "source_youtube"
|
141
|
+
@entries<<Entry_Youtube.new(item, self.charset)
|
142
|
+
else
|
143
|
+
@entries<<Entry.new(item, self.charset)
|
149
144
|
end
|
150
145
|
end
|
151
146
|
end
|
@@ -268,7 +263,10 @@ module Rfeedreader
|
|
268
263
|
@description = (@hpricot_item/"content").text
|
269
264
|
@description = (@hpricot_item/"content\:encoded").text if @description.empty?
|
270
265
|
if @description.empty?
|
266
|
+
puts "content not found"
|
271
267
|
@description = (@hpricot_item/"description|summary|[@type='text']").inner_html
|
268
|
+
|
269
|
+
puts "inner_html: #{@description}"
|
272
270
|
@description.gsub!(/^<!\[CDATA\[/, '')
|
273
271
|
@description.gsub!(/\]\]>$/, '')
|
274
272
|
@description = HTMLEntities.decode_entities(@description)
|
@@ -295,13 +293,6 @@ module Rfeedreader
|
|
295
293
|
"Entry: title: #{@title} - link: #{@link}\n\rdescription: #{@description}"
|
296
294
|
end
|
297
295
|
end
|
298
|
-
|
299
|
-
class Entry_MRSS<Entry
|
300
|
-
def read_description
|
301
|
-
image = @hpricot_item.search("media:thumbnail").to_s.scan(/url=['"]?([^'"]*)['" ]/).to_s
|
302
|
-
@description = "<a href='#{@link}' class='image_link'><img src='#{image}' class='post_image'/></a>"
|
303
|
-
end
|
304
|
-
end
|
305
296
|
|
306
297
|
class Entry_Flickr<Entry
|
307
298
|
def read_description
|
data/lib/rfeedreader/version.rb
CHANGED
data/test/test_rfeedreader.rb
CHANGED
@@ -262,4 +262,12 @@ class TestRfeedreader < Test::Unit::TestCase
|
|
262
262
|
def test_orlandooo
|
263
263
|
read_first "http://orlandooo.com/blog/"
|
264
264
|
end
|
265
|
+
|
266
|
+
def test_juan
|
267
|
+
read_first "http://juan.urrutiaelejalde.org"
|
268
|
+
end
|
269
|
+
|
270
|
+
def test_wordpress
|
271
|
+
read_first "http://argentin.wordpress.com/"
|
272
|
+
end
|
265
273
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rfeedreader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexandre Girard
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-11-
|
12
|
+
date: 2008-11-29 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|