def run(interval = 600)
      @log.debug('aggregator start')

      loop do
        @feeds.each do |feed|
          @log.debug('aggregate ' + feed.url)

          options = {allow_redirections: :safe}

          unless feed.validate_cert
            @log.debug('aggregate certificate validation: false')
            options[:ssl_verify_mode] = OpenSSL::SSL::VERIFY_NONE
          end

          begin
            content = open(feed.url, options).read
          rescue StandardError => e
            @log.debug("retrieval error (#{e.class}: #{e.message})")
            next
          end

          # gzip HTTP Content-Encoding is not automatically decompressed in
          # Ruby 1.9.3.
          content = decompress(content) if RUBY_VERSION == '1.9.3'
          begin
            items = RSS::Parser.parse(content, false).items
          rescue StandardError => e
            @log.debug("parse error (#{e.class}: #{e.message})")
            next
          end

          items.each do |item|
            result = process_link(feed, item)
            next if result.nil?
          end
        end

        if interval == -1
          @log.debug('single run mode, exiting')
          break
        end

        sleep(interval)
      end
    end
def run(interval = 600)
      @log.debug('aggregator start')

      loop do
        @feeds.each do |feed|
          @log.debug('aggregate ' + feed.url)

          options = {allow_redirections: :safe}

          unless feed.validate_cert
            @log.debug('aggregate certificate validation: false')
            options[:ssl_verify_mode] = OpenSSL::SSL::VERIFY_NONE
          end

          begin
            content = open(feed.url, options).read
          rescue StandardError => e
            @log.debug("retrieval error (#{e.class}: #{e.message})")
            next
          end

          # gzip HTTP Content-Encoding is not automatically decompressed in
          # Ruby 1.9.3.
          content = decompress(content) if RUBY_VERSION == '1.9.3'
          begin
            items = RSS::Parser.parse(content, false).items
          rescue StandardError => e
            @log.debug("parse error (#{e.class}: #{e.message})")
            next
          end

          items.each do |item|
            result = process_link(feed, item)
            next if result.nil?
          end
        end

        if interval == -1
          @log.debug('single run mode, exiting')
          break
        end

        sleep(interval)
      end
    end
Get file enclosures from all feeds items and call on_new_item callback
 with torrent file URL as argument.