<commit_before>class LocalLibrary::Scraper

  def self.scrape(zip_code)
    address = "https://search.yahoo.com/search?p=public+library+near+#{zip_code}"
    doc = Nokogiri::HTML(open(address))
    ul = doc.css('div.dd')
    
  end


end
<commit_msg>finished Scraper#scrape_and_create method.<commit_after>class LocalLibrary::Scraper

  def self.scrape_and_create(zip_code)
    address = "https://search.yahoo.com/search?p=public+library+near+#{zip_code}"
    doc = Nokogiri::HTML(open(address))
    ul = doc.css('div.dd')
    ul.css('li.list').each do |a|
      library = LocalLibrary::Library.new(a.css('div.titlewrapper a').text)
      a.css('div.meta span.col.isopen').text == "Open" ? library.status = "Open" : library.status = "Closed"
      library.address = a.css('div.contact span.addr').text
      library.phone = a.css('div.contact span.hoo span')[1].text
      LocalLibrary::Library.libraries << library
    end
  end


end

{'fraction_non_alphanumeric': 0.1623931623931624, 'fraction_numerical': 0.0010683760683760685, 'mean_word_length': 3.984042553191489, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '3489034', 'n_tokens_mistral': 338, 'n_tokens_neox': 327, 'n_words': 49}