concerto_simple_rss 0.4 → 0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd8fe5070190f090d671fd33b4c9ea5ba82725ed
4
- data.tar.gz: d36e0affac8fa2a7f4e33a376cdbf795f1480f2b
3
+ metadata.gz: 5e05cd87dec9e071dcc3766c356e0c6afa2a1069
4
+ data.tar.gz: 83bd375862ea1f5b814f107acff3eb3f36f14f86
5
5
  SHA512:
6
- metadata.gz: 636ac956410a5f277544def93df765cda34c8d9dd70f6db9513e907217df1db4b7fa24e4f02d69eb64b1a916df6e48e2734bcc865eae50473e8ab2ca4c25874d
7
- data.tar.gz: b3347fdeda2e1a14e2918cd5526cf91c7ddf603e57b0d491dbf8562256755af1d9e19d7d85816a0e195e89d7c137ed19c980a2d8d0d4a3915f7b0acc391acea9
6
+ metadata.gz: 6eefd5e0198c1892aea1587e8c6925dec03a30fcdaca2d0655d58871ca11d55b5a96b248d22d1ef32882f00ea021dd3f92529a2bb2dcbdfec5a35f991d1b2089
7
+ data.tar.gz: b4943842f8f9b51ea8057580267d37a48a90ac8189c856936c7cb39437adfe2c622463c195ac734d7a6f11ee2774afb3097db3d5d94efd601367d4bb1425b379
@@ -99,13 +99,28 @@ class SimpleRss < DynamicContent
99
99
  end
100
100
  end
101
101
  rescue => e
102
- Rails.logger.error("unable to parse resultant xml, assuming it is one content item #{e.message}")
103
- # raise "unable to parse resultant xml #{e.message}"
104
- # add the whole result as one content
105
- htmltext = HtmlText.new()
106
- htmltext.name = "#{feed_title}"
107
- htmltext.data = sanitize(data)
108
- contents << htmltext
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.'
@@ -1,3 +1,3 @@
1
1
  module ConcertoSimpleRss
2
- VERSION = "0.4"
2
+ VERSION = "0.5"
3
3
  end
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'
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-06-29 00:00:00.000000000 Z
11
+ date: 2014-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails