<commit_before>class Importer

  URL = "https://www.betradar.com/betradar/getXmlFeed.php"
  PARAMS =  {
              bookmakerName: "UserName",
              xmlFeedName: "Fixtures",
              deleteAfterTransfer: "no",
              key: "123456"
            }

  def self.get_feed
    @xml_string = RestClient.get URL, :params => PARAMS
  end
end<commit_msg>building url and using key and username provided<commit_after>require 'nokogiri'

class Importer

  URL = "https://www.betradar.com/betradar/getXmlFeed.php"

  attr_accessor :feed_name, :user, :key, :options

  def initialize(feed_name, bookmaker, key, options = {})
    self.feed_name = feed_name
    self.user = bookmaker
    self.key = key

    self.options = options
  end

  def get_feed
    @xml_data = Nokogiri::XML(open(build_url))
  end

  private

  def build_url
    generated_url = URL << "?"
    feed_arguments.each_with_index do |(key, value), index|
      generated_url << "#{key}=#{value}"
      generated_url << "&" unless index == feed_arguments.length - 1
    end
    generated_url
  end

  def feed_arguments
    args = {
      bookmakerName: self.user,
      xmlFeedName: self.feed_name,
      key: self.key
    }
    args.merge!(options)
  end

end
{'fraction_non_alphanumeric': 0.10931174089068826, 'fraction_numerical': 0.005668016194331984, 'mean_word_length': 2.68955223880597, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, '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': '7193220', 'n_tokens_mistral': 424, 'n_tokens_neox': 408, 'n_words': 90}