<commit_before>require "json"
require "nokogiri"

module Lyriki
  module Legacy
    class SongLyrics

      def initialize(**args)
        raise ArgumentError unless args[:artist] && args[:song]
        song_data = SongData.new(args).response_data
        @data = Net::HTTP.get(URI(song_data['url']))
      end

      def response_data
        Nokogiri::HTML(@data).css('div.lyricbox/text()').map(&:text)
      end

    end
  end
end<commit_msg>use the get helper<commit_after>require "json"
require "nokogiri"
require "web_helpers"

module Lyriki
  module Legacy
    class SongLyrics

      include WebHelpers

      def initialize(**args)
        raise ArgumentError unless args[:artist] && args[:song]
        song_data = SongData.new(args).response_data
        @data = get(song_data["url"])
      end

      def response_data
        Nokogiri::HTML(@data).css("div.lyricbox/text()").map(&:text)
      end

    end
  end
end
{'fraction_non_alphanumeric': 0.11745689655172414, 'fraction_numerical': 0.0, 'mean_word_length': 2.97008547008547, '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': '7298180', 'n_tokens_mistral': 307, 'n_tokens_neox': 293, 'n_words': 64}