Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Encoding request urls

  • Loading branch information...
commit 6f963e4a3ee1d7208a395e6f80b3272fb3e20c79 1 parent 73cad8e
@ckozus authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/r_weather.rb
View
4 lib/r_weather.rb
@@ -20,7 +20,7 @@ def self.key; @@key; end
def self.key=(value); @@key = value; end
def self.search(where)
- if data = get_and_parse(sprintf(SEARCH_URL, where))
+ if data = get_and_parse(sprintf(SEARCH_URL, URI.encode(where)))
data['loc'].map{|loc| RWeatherLocation.new(loc['type'], loc['id'], loc['content'])}
end
end
@@ -30,7 +30,7 @@ def self.current_conditions(location_id, unit = DEFAULT_UNIT)
url = sprintf(LOCAL_URL, location_id, partner_id, key)
url << "&cc=true"
url << "&unit=#{unit}" if VALID_UNITS.include?(unit)
- if data = get_and_parse(url)
+ if data = get_and_parse(URI.encode(url))
RWeatherCurrentCondition.parse(data)
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.