concerto_simple_rss 0.4 → 0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/simple_rss.rb +22 -7
- data/lib/concerto_simple_rss/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e05cd87dec9e071dcc3766c356e0c6afa2a1069
|
4
|
+
data.tar.gz: 83bd375862ea1f5b814f107acff3eb3f36f14f86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6eefd5e0198c1892aea1587e8c6925dec03a30fcdaca2d0655d58871ca11d55b5a96b248d22d1ef32882f00ea021dd3f92529a2bb2dcbdfec5a35f991d1b2089
|
7
|
+
data.tar.gz: b4943842f8f9b51ea8057580267d37a48a90ac8189c856936c7cb39437adfe2c622463c195ac734d7a6f11ee2774afb3097db3d5d94efd601367d4bb1425b379
|
data/app/models/simple_rss.rb
CHANGED
@@ -99,13 +99,28 @@ class SimpleRss < DynamicContent
|
|
99
99
|
end
|
100
100
|
end
|
101
101
|
rescue => e
|
102
|
-
|
103
|
-
#
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
102
|
+
# maybe the html was not xml compliant-- this happens frequently in rss feed descriptions
|
103
|
+
# look for another separator and use it, if it exists
|
104
|
+
|
105
|
+
if data.include?("</content-item>")
|
106
|
+
# if there are any content-items then add each one as a separate content
|
107
|
+
# and strip off the content-item wrapper
|
108
|
+
data.split("</content-item>").each do |n|
|
109
|
+
htmltext = HtmlText.new()
|
110
|
+
htmltext.name = "#{feed_title}"
|
111
|
+
htmltext.data = sanitize(n.sub("<content-item>", ""))
|
112
|
+
contents << htmltext if !htmltext.data.strip.blank?
|
113
|
+
end
|
114
|
+
|
115
|
+
else
|
116
|
+
Rails.logger.error("unable to parse resultant xml, assuming it is one content item #{e.message}")
|
117
|
+
# raise "unable to parse resultant xml #{e.message}"
|
118
|
+
# add the whole result as one content
|
119
|
+
htmltext = HtmlText.new()
|
120
|
+
htmltext.name = "#{feed_title}"
|
121
|
+
htmltext.data = sanitize(data)
|
122
|
+
contents << htmltext
|
123
|
+
end
|
109
124
|
end
|
110
125
|
else
|
111
126
|
raise ArgumentError, 'Unexpected output format for RSS feed.'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: concerto_simple_rss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.5'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Michalski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|