<commit_before>require "howdoi/version"
require 'nokogiri'
require 'open-uri'

module Howdoi
  class Searcher
    attr_accessor :result

    SITES = {
      "computers" => "http://stackoverflow.com",
      "program" => "http://programmers.stackexchange.com",
      "sysadmin" => "http://serverfault.com"
    }

    def initialize(site)
      search_val = get_search_val
      doc = Nokogiri::HTML(open("#{SITES[site]}/search?q=#{search}"))
      @result = "#{SITES[site]}#{doc.css(".result-link a").first.attribute("href").value}"
    end

    def get_search_val
      errors = File.open("/tmp/howdoi_errors")
    end
  end
end
<commit_msg>Use the correct variable for things<commit_after>require "howdoi/version"
require 'nokogiri'
require 'open-uri'

module Howdoi
  class Searcher
    attr_accessor :result

    SITES = {
      "computers" => "http://stackoverflow.com",
      "program" => "http://programmers.stackexchange.com",
      "sysadmin" => "http://serverfault.com"
    }

    def initialize(site)
      search_val = get_search_val
      doc = Nokogiri::HTML(open("#{SITES[site]}/search?q=#{search_val}"))
      @result = "#{SITES[site]}#{doc.css(".result-link a").first.attribute("href").value}"
    end

    def get_search_val
      errors = File.open("/tmp/howdoi_errors")
    end
  end
end

{'fraction_non_alphanumeric': 0.16079632465543645, 'fraction_numerical': 0.0, 'mean_word_length': 3.3859060402684564, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '1592490', 'n_tokens_mistral': 464, 'n_tokens_neox': 451, 'n_words': 77}