<commit_before>require 'net/http'
require 'json'
require 'open-uri'
require 'pp'

require 'dotenv'
Dotenv.load

module AdoptAPet
  URL = 'http://api.petfinder.com/pet.getRandom'

  PARAMS = {
    format:    'json',
    key:        ENV.fetch('petfinder_key'),
    shelterid: 'VA54', # Norfolk SPCA
    output:    'full'
  }

  SEXES = { m: 'male', f: 'female' }

  def self.random
    pet = fetch_pet while pet.nil? || pet.error?
    pet
  end

  private


  def self.get_breeds(pet)
    breed_list = [pet['breeds']['breed']].flatten          # Coerces into an Array
    breed_list = breed_list.map{ |b| b["$t"] }.join(' / ') # Joins into string
    breed_list << ' mix' if breed_list.include?('/')
    breed_list
  end


  def self.get_photo(pet)
    # Assume that if there isn't a 3rd photo, there is a first one
    # There's some more refactoring to be done here.
<commit_msg>Changed shelter to Animal Care Center<commit_after>require 'net/http'
require 'json'
require 'open-uri'
require 'pp'

require 'dotenv'
Dotenv.load

module AdoptAPet
  URL = 'http://api.petfinder.com/pet.getRandom'

  PARAMS = {
    format:    'json',
    key:        ENV.fetch('petfinder_key'),
    shelterid: 'VA242', # MSPCA in Jamaica Plain
    output:    'full'
  }

  SEXES = { m: 'male', f: 'female' }

  def self.random
    pet = fetch_pet while pet.nil? || pet.error?
    pet
  end

  private


  def self.get_breeds(pet)
    breed_list = [pet['breeds']['breed']].flatten          # Coerces into an Array
    breed_list = breed_list.map{ |b| b["$t"] }.join(' / ') # Joins into string
    breed_list << ' mix' if breed_list.include?('/')
    breed_list
  end


  def self.get_photo(pet)
    # Assume that if there isn't a 3rd photo, there is a first one
    # There's some more refactoring to be done here.

{'fraction_non_alphanumeric': 0.13385387618516453, 'fraction_numerical': 0.0039040713887339654, 'mean_word_length': 2.8663793103448274, 'pattern_counts': {'":': 0, '<': 7, '<?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': '6927459', 'n_tokens_mistral': 670, 'n_tokens_neox': 644, 'n_words': 179}