<commit_before>require 'httparty'
require 'dotenv'
Dotenv.load
module RottenTomatoes
  BASE_URL = "http://api.rottentomatoes.com/api/public/v1.0"
  API_KEY = ENV['ROTTEN_TOMATOES_KEY'] 


  def self.included(base)
    base.extend(ClassMethods)
  end

  def get(id)
    JSON.parse(HTTParty.get(URI.escape("#{BASE_URL}/movies/#{id}.json?apikey=#{API_KEY}")))
  end

  module ClassMethods
    def search(q)
      JSON.parse(HTTParty.get(URI.escape("#{BASE_URL}/movies.json?apikey=#{API_KEY}&q=#{q}")))
    end
  end

end<commit_msg>more explicit method names for rotten tomatoes. search_rt just returns movies array<commit_after>require 'httparty'
require 'dotenv'
Dotenv.load
module RottenTomatoes
  BASE_URL = "http://api.rottentomatoes.com/api/public/v1.0"
  API_KEY = ENV['ROTTEN_TOMATOES_KEY'] 


  def self.included(base)
    base.extend(ClassMethods)
  end

  def get_from_rt(id)
    JSON.parse(HTTParty.get(URI.escape("#{BASE_URL}/movies/#{id}.json?apikey=#{API_KEY}")))
  end

  module ClassMethods
    def search_rt(q)
      JSON.parse(HTTParty.get(URI.escape("#{BASE_URL}/movies.json?apikey=#{API_KEY}&q=#{q}")))["movies"]
    end
  end

end
{'fraction_non_alphanumeric': 0.15404699738903394, 'fraction_numerical': 0.0034812880765883376, 'mean_word_length': 4.721393034825871, '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': '4402814', 'n_tokens_mistral': 459, 'n_tokens_neox': 445, 'n_words': 64}