aggregator/rss.rb
## Get the rss info for the current feed,
#  move on to the next one, and  give the output string.
Get the rss info for the current feed,
move on to the next one, and  give the output string.
Get the rss info for the current feed move on to the next one and give the output string .
def read
    begin
      title              = @current_feed.keys.first
      content            = @cache[@current_feed.keys.first] || fetch_feed
      @current_feed_link = content[0]&.dig('link')
      decoded_content    = HTMLEntities.new.decode(content&.shift&.dig('title'))
      @cache[@current_feed.keys.first] = nil if content.empty?
    rescue StandardError => e
      File.open('errors.log', 'w') { |file| file.write("Error while parsing feed <#{title}>: #{e}\n") }
    end
    next_feed
    "<#{title}>: #{decoded_content || Rss::NO_VALUE}"
  end
def read begin title = @current_feed . keys . first content = @cache [ @current_feed . keys . first ] || fetch_feed @current_feed_link = content [ 0 ] &. dig ( 'link' ) decoded_content = HTMLEntities . new . decode ( content &. shift &. dig ( 'title' ) ) @cache [ @current_feed . keys . first ] = nil if content . empty? rescue StandardError => e File . open ( 'errors.log' , 'w' ) { | file | file . write ( "Error while parsing feed <#{title}>: #{e}\n" ) } end next_feed "<#{title}>: #{decoded_content || Rss::NO_VALUE}" end
Get the rss info for the current feed,
move on to the next one, and  give the output string.
Get the rss info for the current feed move on to the next one and give the output string .
# Error while parsing, something weird during feed fetch/parse, not read (as in pulling off queue), probably # TODO: maybe move this into a util class if we want this to be the way to log errors (because of how CLI works)