<commit_before>require 'net/http'
require 'uri'
require_relative 'weather_data'

module Googleweather
  class Client
    attr_accessor :city, :zip
    attr_reader :weather

    BASE_URL = 'http://www.google.com/ig/api?weather='    
    
    def initialize(city_or_zip)
      if city_or_zip.to_i == 0
        @city  = city_or_zip
      else
        @zip = city_or_zip.to_s
      end     
      
      update_weather    
    end
    
    def now
      @weather.now
    end
    
    def forecast
      @weather.forecast
    end    
    
    def update_weather
      @weather = WeatherData.new(get)
    end    
    
    def url
      URI.parse(BASE_URL + (@city || @zip))
    end 
    
    def get
      resp = Net::HTTP.get_response(url)
      
      if resp.code == "200"<commit_msg>reverting this back for now<commit_after>require 'net/http'
require 'uri'
require_relative 'weather_data'

module Googleweather
  class Client
    attr_accessor :city, :zip
    attr_reader :weather

    BASE_URL = 'http://www.google.com/ig/api?weather='    
    
    def initialize(city_or_zip)
      if city_or_zip.to_i == 0
        @city = city_or_zip
      else
        @zip = city_or_zip
      end    
      
      update_weather    
    end
    
    def now
      @weather.now
    end
    
    def forecast
      @weather.forecast
    end    
    
    def update_weather
      @weather = WeatherData.new(get)
    end    
    
    def url
      URI.parse(BASE_URL + (@city || @zip))
    end 
    
    def get
      resp = Net::HTTP.get_response(url)
      
      if resp.code == "200"
{'fraction_non_alphanumeric': 0.08349267049075844, 'fraction_numerical': 0.005098789037603569, 'mean_word_length': 1.773851590106007, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3597914', 'n_tokens_mistral': 554, 'n_tokens_neox': 520, 'n_words': 115}