<commit_before>require 'rss'
require 'open-uri'

module YYFeed
  class FeedItem
    attr_accessor :title, :date, :link, :data

    def initialize
      @title = nil
      @date = nil
      @link = nil
      @data = nil
    end
  end

  #rss2.0 & rss1.0 & atom specs are integrated within this class.
  class Feed
    attr_accessor :content, :items

    def initialize
      @content = nil
      @items = Array.new
    end

    def title
      if @content.feed_type == "atom"
        return @content.title.content
      elsif @content.feed_type == "rss"
        return @content.channel.title
      end
    end

    def link
      if @content.feed_type == "atom"
        return @content.link.href
      elsif @content.feed_type == "rss"
        return @content.channel.link
      end
    end

    def description
      if @content.feed_type == "atom"
        return ""
      elsif @content.feed_type == "rss"
        return @content.channel.description
      end
    end

    def items
      if @content.feed_type == "atom"
        @content.entries.each do |t|
          itemObj = FeedItem.new
          itemObj.title = t.title.content
          itemObj.date = t.updated.content
          itemObj.link = t.link.href
          itemObj.data = t
          @items.push(itemObj)
        end
      elsif @content.feed_type == "rss"
        @content.channel.items.each do |t|
          itemObj = FeedItem.new     
          itemObj.title = t.title
          itemObj.date = t.pubDate
          itemObj.link = t.link
          @items.push(itemObj)
        end
      end
      return @items
    end
  end

  class FeedMeta
    attr_accessor :feeds

    def initialize
      @feeds = Array.new
    end<commit_msg>[maintenance] I forgot property setting.<commit_after>require 'rss'
require 'open-uri'

module YYFeed
  class FeedItem
    attr_accessor :title, :date, :link, :data

    def initialize
      @title = nil
      @date = nil
      @link = nil
      @data = nil
    end
  end

  #rss2.0 & rss1.0 & atom specs are integrated within this class.
  class Feed
    attr_accessor :content, :items

    def initialize
      @content = nil
      @items = Array.new
    end

    def title
      if @content.feed_type == "atom"
        return @content.title.content
      elsif @content.feed_type == "rss"
        return @content.channel.title
      end
    end

    def link
      if @content.feed_type == "atom"
        return @content.link.href
      elsif @content.feed_type == "rss"
        return @content.channel.link
      end
    end

    def description
      if @content.feed_type == "atom"
        return ""
      elsif @content.feed_type == "rss"
        return @content.channel.description
      end
    end

    def items
      if @content.feed_type == "atom"
        @content.entries.each do |t|
          itemObj = FeedItem.new
          itemObj.title = t.title.content
          itemObj.date = t.updated.content
          itemObj.link = t.link.href
          itemObj.data = t
          @items.push(itemObj)
        end
      elsif @content.feed_type == "rss"
        @content.channel.items.each do |t|
          itemObj = FeedItem.new     
          itemObj.title = t.title
          itemObj.date = t.pubDate
          itemObj.link = t.link
          itemObj.data = t
          @items.push(itemObj)
        end
      end
      return @items
    end
  end

  class FeedMeta
    attr_accessor :feeds

    def initialize
      @feeds = Array.new
    end
{'fraction_non_alphanumeric': 0.09004053271569196, 'fraction_numerical': 0.0023161551823972205, 'mean_word_length': 1.7551834130781498, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7168551', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1054, 'n_words': 279}