Skip to content

Commit

Permalink
Parse RSS feeds that return objects instead of strings. (#1950)
Browse files Browse the repository at this point in the history
Fixes CV2-4906.
  • Loading branch information
caiosba committed Jul 14, 2024
1 parent 4452383 commit e1f235c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/rss_feed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e1f235c

Please sign in to comment.