weather-api 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +7 -3
  3. data/README.md +1 -1
  4. data/lib/weather-api.rb +13 -7
  5. data/lib/weather-api/astronomy.rb +1 -1
  6. data/lib/weather-api/condition.rb +1 -1
  7. data/lib/weather-api/forecast.rb +1 -1
  8. data/lib/weather-api/image.rb +1 -1
  9. data/lib/weather-api/location.rb +1 -1
  10. data/lib/weather-api/response.rb +1 -1
  11. data/lib/weather-api/units.rb +3 -3
  12. data/lib/weather-api/utils.rb +1 -1
  13. data/lib/weather-api/version.rb +1 -1
  14. data/lib/weather-api/wind.rb +1 -1
  15. data/spec/fixtures/cassettes/Weather_Astronomy/should_contain_Time_objects_for_sunrise_and_sunset.yml +61 -1
  16. data/spec/fixtures/cassettes/Weather_Atmosphere/should_contain_a_float_indicating_atmospheric_pressure.yml +61 -1
  17. data/spec/fixtures/cassettes/Weather_Atmosphere/should_contain_a_string_indicating_barometric_pressure.yml +61 -1
  18. data/spec/fixtures/cassettes/Weather_Atmosphere/should_contain_integers_representing_humidity_and_visibility.yml +61 -1
  19. data/spec/fixtures/cassettes/Weather_Condition/should_contain_a_weather_condition_code_a_date_a_temperature_and_a_description.yml +61 -1
  20. data/spec/fixtures/cassettes/Weather_Forecast/should_contain_high_and_low_forecasts.yml +61 -1
  21. data/spec/fixtures/cassettes/Weather_Forecast/should_contain_the_name_of_the_day_associated_with_the_forecast.yml +61 -1
  22. data/spec/fixtures/cassettes/Weather_Forecast/should_have_a_brief_description_of_the_forecasted_conditions.yml +61 -1
  23. data/spec/fixtures/cassettes/Weather_Forecast/should_have_a_weather_condition_code.yml +61 -1
  24. data/spec/fixtures/cassettes/Weather_Forecast/should_have_an_associated_date.yml +61 -1
  25. data/spec/fixtures/cassettes/Weather_Image/should_contain_a_string_for_the_image_url.yml +61 -1
  26. data/spec/fixtures/cassettes/Weather_Location/should_be_able_to_look_up_Nice_France.yml +61 -1
  27. data/spec/fixtures/cassettes/Weather_Location/should_be_able_to_look_up_Seattle_WA.yml +61 -1
  28. data/spec/fixtures/cassettes/Weather_Location/should_be_able_to_look_up_Victoria_BC.yml +61 -1
  29. data/spec/fixtures/cassettes/Weather_Location/should_contain_city_country_and_region_as_strings.yml +61 -1
  30. data/spec/fixtures/cassettes/Weather_Response/should_contain_a_HTML_description_summarizing_weather_conditions.yml +61 -1
  31. data/spec/fixtures/cassettes/Weather_Response/should_contain_a_String_title.yml +61 -1
  32. data/spec/fixtures/cassettes/Weather_Response/should_contain_a_Weather_Astronomy_object.yml +61 -1
  33. data/spec/fixtures/cassettes/Weather_Response/should_contain_a_Weather_Atmosphere_object.yml +61 -1
  34. data/spec/fixtures/cassettes/Weather_Response/should_contain_a_Weather_Condition_object.yml +61 -1
  35. data/spec/fixtures/cassettes/Weather_Response/should_contain_a_Weather_Image_object.yml +61 -1
  36. data/spec/fixtures/cassettes/Weather_Response/should_contain_a_Weather_Location_object.yml +61 -1
  37. data/spec/fixtures/cassettes/Weather_Response/should_contain_a_Weather_Units_object.yml +61 -1
  38. data/spec/fixtures/cassettes/Weather_Response/should_contain_a_Weather_Wind_object.yml +61 -1
  39. data/spec/fixtures/cassettes/Weather_Response/should_contain_a_collection_of_Weather_Forecast_objects.yml +61 -1
  40. data/spec/fixtures/cassettes/Weather_Response/should_contain_latitude_and_longitude_in_floats.yml +61 -1
  41. data/spec/fixtures/cassettes/Weather_Response/should_contain_the_WOEID_of_the_request_location_and_the_requested_URL.yml +61 -1
  42. data/spec/fixtures/cassettes/Weather_Response/should_return_a_RuntimeError_for_an_invalid_WOEID.yml +50 -0
  43. data/spec/fixtures/cassettes/Weather_Units/defaults/should_default_to_imperial_units.yml +61 -1
  44. data/spec/fixtures/cassettes/Weather_Units/defaults/should_default_to_metric_units.yml +63 -0
  45. data/spec/fixtures/cassettes/Weather_Units/defaults/should_switch_to_imperial_if_specified.yml +63 -0
  46. data/spec/fixtures/cassettes/Weather_Units/defaults/should_switch_to_metric_if_specified.yml +62 -1
  47. data/spec/fixtures/cassettes/Weather_Wind/should_contain_chill_direction_and_speed_as_integers.yml +61 -1
  48. data/spec/lib/astronomy_spec.rb +3 -4
  49. data/spec/lib/atmosphere_spec.rb +5 -6
  50. data/spec/lib/condition_spec.rb +5 -6
  51. data/spec/lib/forecast_spec.rb +7 -8
  52. data/spec/lib/image_spec.rb +2 -3
  53. data/spec/lib/response_spec.rb +19 -16
  54. data/spec/lib/units_spec.rb +12 -12
  55. data/spec/lib/wind_spec.rb +4 -5
  56. data/weather-api.gemspec +20 -18
  57. metadata +42 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0505b35dd0b5cc46de98a295927a205e3b3f99b5
4
- data.tar.gz: 454032e2da6f0b8da544546310b972dbeb6f9cb8
3
+ metadata.gz: 0a68642481bfb59135fd3d03a3debfc63b940faf
4
+ data.tar.gz: f008721accb00019c2113ca120c90850f7f13314
5
5
  SHA512:
6
- metadata.gz: 720b5632486ab748b07b18aecf7811fc24c7782e38907fe8b160a966ab8f5a5e04d5f3ffa331fee175501bf8a6c5c617b1d646a57215380e9a665519b3e38374
7
- data.tar.gz: 3b46eac821c0ac12dd4229bbbb03fa6ca400fffb55ced3fa63ea83b719d18a103c4021ae1ddf8a873fae6038dfa82931577ffc6a0385f3e728f185efc7a1397e
6
+ metadata.gz: 56e3a26c3db054a451e77fc492ccca091d4099338d7143b96f5d5f4ac26555a80d5d7dedfd6b5c2576ddcb278c0302c62fc19fc7013326a4deb8a50726ded095
7
+ data.tar.gz: ccb0af7b0de1ec8c0ed0af3f7760a8219c6d00cd3fa5c08f8e354e6a1184d2a4e9e163a4d2386f6c54abb4c6b4052a37002f8846f5db04d7678bdd50c5daa235
@@ -1,4 +1,8 @@
1
+ sudo: false
1
2
  rvm:
2
- - 1.9.2
3
- - 1.9.3
4
- - 2.0.0
3
+ - 1.9.3
4
+ - 2.0.0
5
+ - 2.1.0
6
+ - 2.2.0
7
+ - jruby-19mode
8
+ - rbx-2
data/README.md CHANGED
@@ -22,7 +22,7 @@ A simple example:
22
22
 
23
23
  # look up WOEID via http://weather.yahoo.com; enter location by city
24
24
  # name or zip and WOEID is at end of resulting page url.
25
- response = Weather.lookup(9830)
25
+ response = Weather.lookup(9830, Weather::Units::CELSIUS)
26
26
 
27
27
  print <<EOT
28
28
  #{response.title}
@@ -26,14 +26,20 @@ module Weather
26
26
  # a WOEID, refer to Yahoo!'s documentation
27
27
  # at http://developer.yahoo.com/weather/
28
28
  #
29
- # units - String - whether to retrieve data in Farenheit
30
- # or Celsius. Defaults to Farenheit
29
+ # unit - system of measurement to use. Two acceptable inputs:
30
+ # 'c' - Celsius/Metric measurements
31
+ # 'f' - Fahrenheit/Imperial measurements.
32
+ #
33
+ # To make this easier, you can use the Weather::Units::FAHRENHEIT and
34
+ # Weather::Units::CELSIUS constants. Defaults to Celsius
31
35
  #
32
36
  # Returns a Weather::Response object containing forecast
33
- def lookup woeid, units = 'f'
34
- url = ROOT
35
- url += "?q=select%20*%20from%20weather.forecast%20"
36
- url += "where%20woeid%3D#{woeid}%20and%20u%3D'#{units}'&format=json"
37
+ def lookup(woeid, unit = Units::CELSIUS)
38
+ acceptable_units = [Units::CELSIUS, Units::FAHRENHEIT]
39
+ unit = Units::CELSIUS unless acceptable_units.include?(unit)
40
+
41
+ url = ROOT + "?q=select%20*%20from%20weather.forecast%20"
42
+ url += "where%20woeid%3D#{woeid}%20and%20u%3D'#{unit}'&format=json"
37
43
 
38
44
  doc = get_response url
39
45
  Response.new woeid, url, doc
@@ -49,7 +55,7 @@ module Weather
49
55
 
50
56
  response = Map.new(JSON.parse(response))[:query][:results][:channel]
51
57
 
52
- if response.nil?
58
+ if response.nil? or response.title.match(/error/i)
53
59
  raise "Failed to get weather [url=#{url}]."
54
60
  end
55
61
 
@@ -6,7 +6,7 @@ module Weather
6
6
  # a Time object containing the sunset time for a location
7
7
  attr_reader :sunset
8
8
 
9
- def initialize payload
9
+ def initialize(payload)
10
10
  @sunrise = Utils.parse_time payload[:sunrise]
11
11
  @sunset = Utils.parse_time payload[:sunset]
12
12
  end
@@ -12,7 +12,7 @@ module Weather
12
12
  # the brief prose text description of the weather conditions of the location.
13
13
  attr_reader :text
14
14
 
15
- def initialize payload
15
+ def initialize(payload)
16
16
  @code = payload[:code].to_i
17
17
  @date = Utils.parse_time payload[:date]
18
18
  @temp = payload[:temp].to_i
@@ -18,7 +18,7 @@ module Weather
18
18
  # the weather condition code, detailed at http://developer.yahoo.com/weather
19
19
  attr_reader :code
20
20
 
21
- def initialize payload
21
+ def initialize(payload)
22
22
  @day = payload[:day]
23
23
  @date = Utils.parse_time payload[:date]
24
24
  @low = payload[:low].to_i
@@ -3,7 +3,7 @@ module Weather
3
3
  # the full URL to the image
4
4
  attr_reader :url
5
5
 
6
- def initialize payload
6
+ def initialize(payload)
7
7
  @url = payload.scan(/src=\"(.*)\"/).flatten.first
8
8
  end
9
9
  end
@@ -9,7 +9,7 @@ module Weather
9
9
  # name of the region, such as a state or province
10
10
  attr_reader :region
11
11
 
12
- def initialize payload
12
+ def initialize(payload)
13
13
  @city = payload[:city]
14
14
  @country = payload[:country]
15
15
  @region = payload[:region]
@@ -52,7 +52,7 @@ module Weather
52
52
  # the title of the weather information for the requested location
53
53
  attr_reader :title
54
54
 
55
- def initialize request_location, request_url, doc
55
+ def initialize(request_location, request_url, doc)
56
56
  # save the request params
57
57
  @request_location = request_location
58
58
  @request_url = request_url
@@ -1,10 +1,10 @@
1
1
  module Weather
2
2
  class Units
3
- FARENHEIT = 'f'
3
+ FAHRENHEIT = 'f'
4
4
  CELSIUS = 'c'
5
5
 
6
6
  # the unit in which temperature is measured
7
- # e.g. F for Farenheit, and C for Celsius
7
+ # e.g. F for Fahrenheit, and C for Celsius
8
8
  attr_reader :temperature
9
9
 
10
10
  # the unit in which distance is measured
@@ -19,7 +19,7 @@ module Weather
19
19
  # e.g. mph for miles per hour, and kph for kilometers per hour
20
20
  attr_reader :speed
21
21
 
22
- def initialize payload
22
+ def initialize(payload)
23
23
  @temperature = payload[:temperature]
24
24
  @distance = payload[:distance]
25
25
  @pressure = payload[:pressure]
@@ -6,7 +6,7 @@ module Weather
6
6
  # Attempts to convert passed text into a Time object
7
7
  #
8
8
  # Returns a Time object or nil
9
- def self.parse_time text = ''
9
+ def self.parse_time(text = '')
10
10
  if text == ''
11
11
  return nil
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module Weather
2
- VERSION = "1.1.1"
2
+ VERSION = "1.2.0" unless defined?(Weather::VERSION)
3
3
  end
@@ -9,7 +9,7 @@ module Weather
9
9
  # the windspeed
10
10
  attr_reader :speed
11
11
 
12
- def initialize payload
12
+ def initialize(payload)
13
13
  @chill = payload[:chill].to_i
14
14
  @direction = payload[:direction].to_i
15
15
  @speed = payload[:speed].to_i
@@ -59,4 +59,64 @@ http_interactions:
59
59
  Mar 2013","day":"Fri","high":"55","low":"44","text":"AM Clouds/PM Sun"}],"guid":{"isPermaLink":"false","content":"CAXX0523_2013_03_29_7_00_PDT"}}}}}}'
60
60
  http_version:
61
61
  recorded_at: Fri, 29 Mar 2013 07:15:45 GMT
62
- recorded_with: VCR 2.4.0
62
+ - request:
63
+ method: get
64
+ uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u='c'
65
+ body:
66
+ encoding: US-ASCII
67
+ string: ''
68
+ headers:
69
+ Accept-Encoding:
70
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
71
+ Accept:
72
+ - '*/*'
73
+ User-Agent:
74
+ - Ruby
75
+ Host:
76
+ - query.yahooapis.com
77
+ response:
78
+ status:
79
+ code: 200
80
+ message: OK
81
+ headers:
82
+ X-Yql-Host:
83
+ - engine7.yql.gq1.yahoo.com
84
+ Access-Control-Allow-Origin:
85
+ - '*'
86
+ Cache-Control:
87
+ - public, max-age=199
88
+ Content-Type:
89
+ - application/json;charset=utf-8
90
+ Date:
91
+ - Fri, 08 Nov 2013 19:29:11 GMT
92
+ Server:
93
+ - YTS/1.20.13
94
+ Age:
95
+ - '1'
96
+ Transfer-Encoding:
97
+ - chunked
98
+ Connection:
99
+ - keep-alive
100
+ body:
101
+ encoding: UTF-8
102
+ string: '{"query":{"count":1,"created":"2013-11-08T19:29:12Z","lang":"en-US","results":{"channel":{"title":"Yahoo!
103
+ Weather - Victoria, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Victoria__CA/*http://weather.yahoo.com/forecast/CAXX0523_c.html","description":"Yahoo!
104
+ Weather for Victoria, CA","language":"en-us","lastBuildDate":"Fri, 08 Nov
105
+ 2013 11:00 am PST","ttl":"60","location":{"city":"Victoria","country":"Canada","region":"BC"},"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"wind":{"chill":"8","direction":"270","speed":"14.48"},"atmosphere":{"humidity":"66","pressure":"1020.2","rising":"1","visibility":""},"astronomy":{"sunrise":"7:09
106
+ am","sunset":"4:43 pm"},"image":{"title":"Yahoo! Weather","width":"142","height":"18","link":"http://weather.yahoo.com","url":"http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif"},"item":{"title":"Conditions
107
+ for Victoria, CA at 11:00 am PST","lat":"48.43","long":"-123.36","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Victoria__CA/*http://weather.yahoo.com/forecast/CAXX0523_c.html","pubDate":"Fri,
108
+ 08 Nov 2013 11:00 am PST","condition":{"code":"28","date":"Fri, 08 Nov 2013
109
+ 11:00 am PST","temp":"10","text":"Mostly Cloudy"},"description":"\n<img src=\"http://l.yimg.com/a/i/us/we/52/28.gif\"/><br
110
+ />\n<b>Current Conditions:</b><br />\nMostly Cloudy, 10 C<BR />\n<BR /><b>Forecast:</b><BR
111
+ />\nFri - PM Showers. High: 9 Low: 6<br />\nSat - Showers. High: 8 Low: 6<br
112
+ />\nSun - AM Showers. High: 8 Low: 6<br />\nMon - Cloudy. High: 9 Low: 7<br
113
+ />\nTue - Rain. High: 9 Low: 7<br />\n<br />\n<a href=\"http://us.rd.yahoo.com/dailynews/rss/weather/Victoria__CA/*http://weather.yahoo.com/forecast/CAXX0523_c.html\">Full
114
+ Forecast at Yahoo! Weather</a><BR/><BR/>\n(provided by <a href=\"http://www.weather.com\"
115
+ >The Weather Channel</a>)<br/>\n","forecast":[{"code":"39","date":"8 Nov 2013","day":"Fri","high":"9","low":"6","text":"PM
116
+ Showers"},{"code":"11","date":"9 Nov 2013","day":"Sat","high":"8","low":"6","text":"Showers"},{"code":"39","date":"10
117
+ Nov 2013","day":"Sun","high":"8","low":"6","text":"AM Showers"},{"code":"26","date":"11
118
+ Nov 2013","day":"Mon","high":"9","low":"7","text":"Cloudy"},{"code":"12","date":"12
119
+ Nov 2013","day":"Tue","high":"9","low":"7","text":"Rain"}],"guid":{"isPermaLink":"false","content":"CAXX0523_2013_11_12_7_00_PST"}}}}}}'
120
+ http_version:
121
+ recorded_at: Fri, 08 Nov 2013 19:29:13 GMT
122
+ recorded_with: VCR 2.6.0
@@ -59,4 +59,64 @@ http_interactions:
59
59
  Mar 2013","day":"Fri","high":"55","low":"44","text":"AM Clouds/PM Sun"}],"guid":{"isPermaLink":"false","content":"CAXX0523_2013_03_29_7_00_PDT"}}}}}}'
60
60
  http_version:
61
61
  recorded_at: Fri, 29 Mar 2013 07:15:45 GMT
62
- recorded_with: VCR 2.4.0
62
+ - request:
63
+ method: get
64
+ uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u='c'
65
+ body:
66
+ encoding: US-ASCII
67
+ string: ''
68
+ headers:
69
+ Accept-Encoding:
70
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
71
+ Accept:
72
+ - '*/*'
73
+ User-Agent:
74
+ - Ruby
75
+ Host:
76
+ - query.yahooapis.com
77
+ response:
78
+ status:
79
+ code: 200
80
+ message: OK
81
+ headers:
82
+ X-Yql-Host:
83
+ - engine6.yql.gq1.yahoo.com
84
+ Access-Control-Allow-Origin:
85
+ - '*'
86
+ Cache-Control:
87
+ - public, max-age=199
88
+ Content-Type:
89
+ - application/json;charset=utf-8
90
+ Date:
91
+ - Fri, 08 Nov 2013 19:29:12 GMT
92
+ Server:
93
+ - YTS/1.20.13
94
+ Age:
95
+ - '3'
96
+ Content-Length:
97
+ - '2345'
98
+ Connection:
99
+ - keep-alive
100
+ body:
101
+ encoding: UTF-8
102
+ string: '{"query":{"count":1,"created":"2013-11-08T19:29:13Z","lang":"en-US","results":{"channel":{"title":"Yahoo!
103
+ Weather - Victoria, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Victoria__CA/*http://weather.yahoo.com/forecast/CAXX0523_c.html","description":"Yahoo!
104
+ Weather for Victoria, CA","language":"en-us","lastBuildDate":"Fri, 08 Nov
105
+ 2013 10:00 am PST","ttl":"60","location":{"city":"Victoria","country":"Canada","region":"BC"},"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"wind":{"chill":"8","direction":"260","speed":"14.48"},"atmosphere":{"humidity":"71","pressure":"1019.9","rising":"1","visibility":""},"astronomy":{"sunrise":"7:09
106
+ am","sunset":"4:43 pm"},"image":{"title":"Yahoo! Weather","width":"142","height":"18","link":"http://weather.yahoo.com","url":"http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif"},"item":{"title":"Conditions
107
+ for Victoria, CA at 10:00 am PST","lat":"48.43","long":"-123.36","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Victoria__CA/*http://weather.yahoo.com/forecast/CAXX0523_c.html","pubDate":"Fri,
108
+ 08 Nov 2013 10:00 am PST","condition":{"code":"28","date":"Fri, 08 Nov 2013
109
+ 10:00 am PST","temp":"10","text":"Mostly Cloudy"},"description":"\n<img src=\"http://l.yimg.com/a/i/us/we/52/28.gif\"/><br
110
+ />\n<b>Current Conditions:</b><br />\nMostly Cloudy, 10 C<BR />\n<BR /><b>Forecast:</b><BR
111
+ />\nFri - PM Showers. High: 9 Low: 6<br />\nSat - Showers. High: 8 Low: 6<br
112
+ />\nSun - AM Showers. High: 8 Low: 6<br />\nMon - Cloudy. High: 9 Low: 7<br
113
+ />\nTue - Rain. High: 9 Low: 7<br />\n<br />\n<a href=\"http://us.rd.yahoo.com/dailynews/rss/weather/Victoria__CA/*http://weather.yahoo.com/forecast/CAXX0523_c.html\">Full
114
+ Forecast at Yahoo! Weather</a><BR/><BR/>\n(provided by <a href=\"http://www.weather.com\"
115
+ >The Weather Channel</a>)<br/>\n","forecast":[{"code":"39","date":"8 Nov 2013","day":"Fri","high":"9","low":"6","text":"PM
116
+ Showers"},{"code":"11","date":"9 Nov 2013","day":"Sat","high":"8","low":"6","text":"Showers"},{"code":"39","date":"10
117
+ Nov 2013","day":"Sun","high":"8","low":"6","text":"AM Showers"},{"code":"26","date":"11
118
+ Nov 2013","day":"Mon","high":"9","low":"7","text":"Cloudy"},{"code":"12","date":"12
119
+ Nov 2013","day":"Tue","high":"9","low":"7","text":"Rain"}],"guid":{"isPermaLink":"false","content":"CAXX0523_2013_11_12_7_00_PST"}}}}}}'
120
+ http_version:
121
+ recorded_at: Fri, 08 Nov 2013 19:29:15 GMT
122
+ recorded_with: VCR 2.6.0
@@ -59,4 +59,64 @@ http_interactions:
59
59
  Mar 2013","day":"Fri","high":"55","low":"44","text":"AM Clouds/PM Sun"}],"guid":{"isPermaLink":"false","content":"CAXX0523_2013_03_29_7_00_PDT"}}}}}}'
60
60
  http_version:
61
61
  recorded_at: Fri, 29 Mar 2013 07:15:45 GMT
62
- recorded_with: VCR 2.4.0
62
+ - request:
63
+ method: get
64
+ uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u='c'
65
+ body:
66
+ encoding: US-ASCII
67
+ string: ''
68
+ headers:
69
+ Accept-Encoding:
70
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
71
+ Accept:
72
+ - '*/*'
73
+ User-Agent:
74
+ - Ruby
75
+ Host:
76
+ - query.yahooapis.com
77
+ response:
78
+ status:
79
+ code: 200
80
+ message: OK
81
+ headers:
82
+ X-Yql-Host:
83
+ - engine7.yql.gq1.yahoo.com
84
+ Access-Control-Allow-Origin:
85
+ - '*'
86
+ Cache-Control:
87
+ - public, max-age=199
88
+ Content-Type:
89
+ - application/json;charset=utf-8
90
+ Date:
91
+ - Fri, 08 Nov 2013 19:29:11 GMT
92
+ Server:
93
+ - YTS/1.20.13
94
+ Age:
95
+ - '2'
96
+ Content-Length:
97
+ - '2345'
98
+ Connection:
99
+ - keep-alive
100
+ body:
101
+ encoding: UTF-8
102
+ string: '{"query":{"count":1,"created":"2013-11-08T19:29:12Z","lang":"en-US","results":{"channel":{"title":"Yahoo!
103
+ Weather - Victoria, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Victoria__CA/*http://weather.yahoo.com/forecast/CAXX0523_c.html","description":"Yahoo!
104
+ Weather for Victoria, CA","language":"en-us","lastBuildDate":"Fri, 08 Nov
105
+ 2013 11:00 am PST","ttl":"60","location":{"city":"Victoria","country":"Canada","region":"BC"},"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"wind":{"chill":"8","direction":"270","speed":"14.48"},"atmosphere":{"humidity":"66","pressure":"1020.2","rising":"1","visibility":""},"astronomy":{"sunrise":"7:09
106
+ am","sunset":"4:43 pm"},"image":{"title":"Yahoo! Weather","width":"142","height":"18","link":"http://weather.yahoo.com","url":"http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif"},"item":{"title":"Conditions
107
+ for Victoria, CA at 11:00 am PST","lat":"48.43","long":"-123.36","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Victoria__CA/*http://weather.yahoo.com/forecast/CAXX0523_c.html","pubDate":"Fri,
108
+ 08 Nov 2013 11:00 am PST","condition":{"code":"28","date":"Fri, 08 Nov 2013
109
+ 11:00 am PST","temp":"10","text":"Mostly Cloudy"},"description":"\n<img src=\"http://l.yimg.com/a/i/us/we/52/28.gif\"/><br
110
+ />\n<b>Current Conditions:</b><br />\nMostly Cloudy, 10 C<BR />\n<BR /><b>Forecast:</b><BR
111
+ />\nFri - PM Showers. High: 9 Low: 6<br />\nSat - Showers. High: 8 Low: 6<br
112
+ />\nSun - AM Showers. High: 8 Low: 6<br />\nMon - Cloudy. High: 9 Low: 7<br
113
+ />\nTue - Rain. High: 9 Low: 7<br />\n<br />\n<a href=\"http://us.rd.yahoo.com/dailynews/rss/weather/Victoria__CA/*http://weather.yahoo.com/forecast/CAXX0523_c.html\">Full
114
+ Forecast at Yahoo! Weather</a><BR/><BR/>\n(provided by <a href=\"http://www.weather.com\"
115
+ >The Weather Channel</a>)<br/>\n","forecast":[{"code":"39","date":"8 Nov 2013","day":"Fri","high":"9","low":"6","text":"PM
116
+ Showers"},{"code":"11","date":"9 Nov 2013","day":"Sat","high":"8","low":"6","text":"Showers"},{"code":"39","date":"10
117
+ Nov 2013","day":"Sun","high":"8","low":"6","text":"AM Showers"},{"code":"26","date":"11
118
+ Nov 2013","day":"Mon","high":"9","low":"7","text":"Cloudy"},{"code":"12","date":"12
119
+ Nov 2013","day":"Tue","high":"9","low":"7","text":"Rain"}],"guid":{"isPermaLink":"false","content":"CAXX0523_2013_11_12_7_00_PST"}}}}}}'
120
+ http_version:
121
+ recorded_at: Fri, 08 Nov 2013 19:29:14 GMT
122
+ recorded_with: VCR 2.6.0
@@ -59,4 +59,64 @@ http_interactions:
59
59
  Mar 2013","day":"Fri","high":"55","low":"44","text":"AM Clouds/PM Sun"}],"guid":{"isPermaLink":"false","content":"CAXX0523_2013_03_29_7_00_PDT"}}}}}}'
60
60
  http_version:
61
61
  recorded_at: Fri, 29 Mar 2013 07:15:45 GMT
62
- recorded_with: VCR 2.4.0
62
+ - request:
63
+ method: get
64
+ uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u='c'
65
+ body:
66
+ encoding: US-ASCII
67
+ string: ''
68
+ headers:
69
+ Accept-Encoding:
70
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
71
+ Accept:
72
+ - '*/*'
73
+ User-Agent:
74
+ - Ruby
75
+ Host:
76
+ - query.yahooapis.com
77
+ response:
78
+ status:
79
+ code: 200
80
+ message: OK
81
+ headers:
82
+ X-Yql-Host:
83
+ - engine6.yql.gq1.yahoo.com
84
+ Access-Control-Allow-Origin:
85
+ - '*'
86
+ Cache-Control:
87
+ - public, max-age=199
88
+ Content-Type:
89
+ - application/json;charset=utf-8
90
+ Date:
91
+ - Fri, 08 Nov 2013 19:29:12 GMT
92
+ Server:
93
+ - YTS/1.20.13
94
+ Age:
95
+ - '1'
96
+ Transfer-Encoding:
97
+ - chunked
98
+ Connection:
99
+ - keep-alive
100
+ body:
101
+ encoding: UTF-8
102
+ string: '{"query":{"count":1,"created":"2013-11-08T19:29:13Z","lang":"en-US","results":{"channel":{"title":"Yahoo!
103
+ Weather - Victoria, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Victoria__CA/*http://weather.yahoo.com/forecast/CAXX0523_c.html","description":"Yahoo!
104
+ Weather for Victoria, CA","language":"en-us","lastBuildDate":"Fri, 08 Nov
105
+ 2013 10:00 am PST","ttl":"60","location":{"city":"Victoria","country":"Canada","region":"BC"},"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"wind":{"chill":"8","direction":"260","speed":"14.48"},"atmosphere":{"humidity":"71","pressure":"1019.9","rising":"1","visibility":""},"astronomy":{"sunrise":"7:09
106
+ am","sunset":"4:43 pm"},"image":{"title":"Yahoo! Weather","width":"142","height":"18","link":"http://weather.yahoo.com","url":"http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif"},"item":{"title":"Conditions
107
+ for Victoria, CA at 10:00 am PST","lat":"48.43","long":"-123.36","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Victoria__CA/*http://weather.yahoo.com/forecast/CAXX0523_c.html","pubDate":"Fri,
108
+ 08 Nov 2013 10:00 am PST","condition":{"code":"28","date":"Fri, 08 Nov 2013
109
+ 10:00 am PST","temp":"10","text":"Mostly Cloudy"},"description":"\n<img src=\"http://l.yimg.com/a/i/us/we/52/28.gif\"/><br
110
+ />\n<b>Current Conditions:</b><br />\nMostly Cloudy, 10 C<BR />\n<BR /><b>Forecast:</b><BR
111
+ />\nFri - PM Showers. High: 9 Low: 6<br />\nSat - Showers. High: 8 Low: 6<br
112
+ />\nSun - AM Showers. High: 8 Low: 6<br />\nMon - Cloudy. High: 9 Low: 7<br
113
+ />\nTue - Rain. High: 9 Low: 7<br />\n<br />\n<a href=\"http://us.rd.yahoo.com/dailynews/rss/weather/Victoria__CA/*http://weather.yahoo.com/forecast/CAXX0523_c.html\">Full
114
+ Forecast at Yahoo! Weather</a><BR/><BR/>\n(provided by <a href=\"http://www.weather.com\"
115
+ >The Weather Channel</a>)<br/>\n","forecast":[{"code":"39","date":"8 Nov 2013","day":"Fri","high":"9","low":"6","text":"PM
116
+ Showers"},{"code":"11","date":"9 Nov 2013","day":"Sat","high":"8","low":"6","text":"Showers"},{"code":"39","date":"10
117
+ Nov 2013","day":"Sun","high":"8","low":"6","text":"AM Showers"},{"code":"26","date":"11
118
+ Nov 2013","day":"Mon","high":"9","low":"7","text":"Cloudy"},{"code":"12","date":"12
119
+ Nov 2013","day":"Tue","high":"9","low":"7","text":"Rain"}],"guid":{"isPermaLink":"false","content":"CAXX0523_2013_11_12_7_00_PST"}}}}}}'
120
+ http_version:
121
+ recorded_at: Fri, 08 Nov 2013 19:29:14 GMT
122
+ recorded_with: VCR 2.6.0
@@ -59,4 +59,64 @@ http_interactions:
59
59
  Mar 2013","day":"Fri","high":"55","low":"44","text":"AM Clouds/PM Sun"}],"guid":{"isPermaLink":"false","content":"CAXX0523_2013_03_29_7_00_PDT"}}}}}}'
60
60
  http_version:
61
61
  recorded_at: Fri, 29 Mar 2013 07:15:46 GMT
62
- recorded_with: VCR 2.4.0
62
+ - request:
63
+ method: get
64
+ uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u='c'
65
+ body:
66
+ encoding: US-ASCII
67
+ string: ''
68
+ headers:
69
+ Accept-Encoding:
70
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
71
+ Accept:
72
+ - '*/*'
73
+ User-Agent:
74
+ - Ruby
75
+ Host:
76
+ - query.yahooapis.com
77
+ response:
78
+ status:
79
+ code: 200
80
+ message: OK
81
+ headers:
82
+ X-Yql-Host:
83
+ - engine6.yql.gq1.yahoo.com
84
+ Access-Control-Allow-Origin:
85
+ - '*'
86
+ Cache-Control:
87
+ - public, max-age=200
88
+ Content-Type:
89
+ - application/json;charset=utf-8
90
+ Date:
91
+ - Fri, 08 Nov 2013 19:29:15 GMT
92
+ Server:
93
+ - YTS/1.20.13
94
+ Age:
95
+ - '0'
96
+ Transfer-Encoding:
97
+ - chunked
98
+ Connection:
99
+ - keep-alive
100
+ body:
101
+ encoding: UTF-8
102
+ string: '{"query":{"count":1,"created":"2013-11-08T19:29:15Z","lang":"en-US","results":{"channel":{"title":"Yahoo!
103
+ Weather - Victoria, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Victoria__CA/*http://weather.yahoo.com/forecast/CAXX0523_c.html","description":"Yahoo!
104
+ Weather for Victoria, CA","language":"en-us","lastBuildDate":"Fri, 08 Nov
105
+ 2013 11:00 am PST","ttl":"60","location":{"city":"Victoria","country":"Canada","region":"BC"},"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"wind":{"chill":"8","direction":"270","speed":"14.48"},"atmosphere":{"humidity":"66","pressure":"1020.2","rising":"1","visibility":""},"astronomy":{"sunrise":"7:09
106
+ am","sunset":"4:43 pm"},"image":{"title":"Yahoo! Weather","width":"142","height":"18","link":"http://weather.yahoo.com","url":"http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif"},"item":{"title":"Conditions
107
+ for Victoria, CA at 11:00 am PST","lat":"48.43","long":"-123.36","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Victoria__CA/*http://weather.yahoo.com/forecast/CAXX0523_c.html","pubDate":"Fri,
108
+ 08 Nov 2013 11:00 am PST","condition":{"code":"28","date":"Fri, 08 Nov 2013
109
+ 11:00 am PST","temp":"10","text":"Mostly Cloudy"},"description":"\n<img src=\"http://l.yimg.com/a/i/us/we/52/28.gif\"/><br
110
+ />\n<b>Current Conditions:</b><br />\nMostly Cloudy, 10 C<BR />\n<BR /><b>Forecast:</b><BR
111
+ />\nFri - PM Showers. High: 9 Low: 6<br />\nSat - Showers. High: 8 Low: 6<br
112
+ />\nSun - AM Showers. High: 8 Low: 6<br />\nMon - Cloudy. High: 9 Low: 7<br
113
+ />\nTue - Rain. High: 9 Low: 7<br />\n<br />\n<a href=\"http://us.rd.yahoo.com/dailynews/rss/weather/Victoria__CA/*http://weather.yahoo.com/forecast/CAXX0523_c.html\">Full
114
+ Forecast at Yahoo! Weather</a><BR/><BR/>\n(provided by <a href=\"http://www.weather.com\"
115
+ >The Weather Channel</a>)<br/>\n","forecast":[{"code":"39","date":"8 Nov 2013","day":"Fri","high":"9","low":"6","text":"PM
116
+ Showers"},{"code":"11","date":"9 Nov 2013","day":"Sat","high":"8","low":"6","text":"Showers"},{"code":"39","date":"10
117
+ Nov 2013","day":"Sun","high":"8","low":"6","text":"AM Showers"},{"code":"26","date":"11
118
+ Nov 2013","day":"Mon","high":"9","low":"7","text":"Cloudy"},{"code":"12","date":"12
119
+ Nov 2013","day":"Tue","high":"9","low":"7","text":"Rain"}],"guid":{"isPermaLink":"false","content":"CAXX0523_2013_11_12_7_00_PST"}}}}}}'
120
+ http_version:
121
+ recorded_at: Fri, 08 Nov 2013 19:29:16 GMT
122
+ recorded_with: VCR 2.6.0