From f40a9b3b3be05b4315d312046f1e8a0364b36839 Mon Sep 17 00:00:00 2001 From: Caio Almeida <117518+caiosba@users.noreply.github.com> Date: Sun, 14 Jul 2024 17:21:12 -0300 Subject: [PATCH] Parse RSS feeds that return objects instead of strings. (#1950) Fixes CV2-4906. --- lib/rss_feed.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/rss_feed.rb b/lib/rss_feed.rb index 767a0eb413..76255bc003 100644 --- a/lib/rss_feed.rb +++ b/lib/rss_feed.rb @@ -18,7 +18,9 @@ def get_articles(count = 3) feed = RSS::Parser.parse(rss, false) unless feed.nil? feed.items.first(count).each do |item| - output << item.title.strip + "\n" + item.link.strip + title = item.title.kind_of?(String) ? item.title : item.title.content + link = item.link.kind_of?(String) ? item.link : item.link.href + output << title.to_s.strip + "\n" + link.to_s.strip end end end