├── Gemfile ├── .travis.yml ├── lib ├── weather-api │ ├── version.rb │ ├── image.rb │ ├── astronomy.rb │ ├── utils.rb │ ├── location.rb │ ├── wind.rb │ ├── condition.rb │ ├── forecast.rb │ ├── units.rb │ ├── atmosphere.rb │ └── response.rb └── weather-api.rb ├── spec ├── lib │ ├── version_spec.rb │ ├── image_spec.rb │ ├── utils_spec.rb │ ├── astronomy_spec.rb │ ├── wind_spec.rb │ ├── condition_spec.rb │ ├── atmosphere_spec.rb │ ├── forecast_spec.rb │ ├── units_spec.rb │ ├── location_spec.rb │ └── response_spec.rb ├── spec_helper.rb └── fixtures │ └── cassettes │ ├── Weather_Response │ ├── should_return_a_RuntimeError_for_an_invalid_WOEID.yml │ ├── should_contain_a_Weather_Units_object.yml │ ├── should_contain_latitude_and_longitude_in_floats.yml │ ├── should_contain_a_HTML_description_summarizing_weather_conditions.yml │ ├── should_contain_a_String_title.yml │ ├── should_contain_a_Weather_Image_object.yml │ ├── should_contain_a_Weather_Wind_object.yml │ ├── should_contain_a_Weather_Astronomy_object.yml │ ├── should_contain_a_Weather_Atmosphere_object.yml │ ├── should_contain_a_Weather_Condition_object.yml │ ├── should_contain_a_Weather_Location_object.yml │ ├── should_contain_a_collection_of_Weather_Forecast_objects.yml │ └── should_contain_the_WOEID_of_the_request_location_and_the_requested_URL.yml │ ├── Weather_Image │ └── should_contain_a_string_for_the_image_url.yml │ ├── Weather_Location │ ├── should_be_able_to_look_up_Victoria_BC.yml │ ├── should_be_able_to_look_up_Seattle_WA.yml │ ├── should_contain_city_country_and_region_as_strings.yml │ └── should_be_able_to_look_up_Nice_France.yml │ ├── Weather_Units │ └── defaults │ │ ├── should_switch_to_imperial_if_specified.yml │ │ └── should_default_to_metric_units.yml │ ├── Weather_Atmosphere │ ├── should_contain_integers_representing_humidity_and_visibility.yml │ ├── should_contain_a_float_indicating_atmospheric_pressure.yml │ └── should_contain_a_string_indicating_barometric_pressure.yml │ ├── Weather_Forecast │ ├── should_have_a_brief_description_of_the_forecasted_conditions.yml │ ├── should_have_an_associated_date.yml │ ├── should_contain_high_and_low_forecasts.yml │ ├── should_have_a_weather_condition_code.yml │ └── should_contain_the_name_of_the_day_associated_with_the_forecast.yml │ ├── Weather_Astronomy │ └── should_contain_Time_objects_for_sunrise_and_sunset.yml │ ├── Weather_Wind │ └── should_contain_chill_direction_and_speed_as_integers.yml │ └── Weather_Condition │ └── should_contain_a_weather_condition_code_a_date_a_temperature_and_a_description.yml ├── .gitignore ├── Rakefile ├── LICENSE ├── README.md └── weather-api.gemspec /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gemspec 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | rvm: 3 | - 2.2.6 4 | - 2.3.3 5 | - 2.4.0 6 | -------------------------------------------------------------------------------- /lib/weather-api/version.rb: -------------------------------------------------------------------------------- 1 | module Weather 2 | VERSION = "1.4.0" unless defined?(Weather::VERSION) 3 | end 4 | -------------------------------------------------------------------------------- /spec/lib/version_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Weather do 4 | it "should return a string" do 5 | expect(Weather::VERSION).to be_a String 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /lib/weather-api/image.rb: -------------------------------------------------------------------------------- 1 | module Weather 2 | class Image 3 | # the full URL to the image 4 | attr_reader :url 5 | 6 | def initialize(payload) 7 | @url = payload.scan(/src=\"(.*)\"/).flatten.first 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.gem 2 | *.rbc 3 | .bundle 4 | .config 5 | .yardoc 6 | Gemfile.lock 7 | InstalledFiles 8 | _yardoc 9 | coverage 10 | doc/ 11 | lib/bundler/man 12 | pkg 13 | rdoc 14 | spec/reports 15 | test/tmp 16 | test/version_tmp 17 | tmp 18 | coverage 19 | -------------------------------------------------------------------------------- /spec/lib/image_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Weather::Image, :vcr do 4 | let(:response) { Weather.lookup 9848 } 5 | let(:image) { response.image } 6 | 7 | it 'should contain a string for the image url' do 8 | expect(image.url).to be_a String 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rake 2 | require "bundler/gem_tasks" 3 | 4 | task :default => :spec 5 | 6 | require 'rspec/core/rake_task' 7 | RSpec::Core::RakeTask.new(:spec) 8 | 9 | desc 'Open an irb session preloaded with this library' 10 | task :console do 11 | sh 'irb -Ilib -rweather-api' 12 | end 13 | -------------------------------------------------------------------------------- /spec/lib/utils_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Weather::Utils do 4 | it 'should parse text into a Time object' do 5 | expect(Weather::Utils.parse_time '2007-01-31 12:22:26').to be_a Time 6 | end 7 | 8 | it 'should return nil if passed nothing' do 9 | expect(Weather::Utils.parse_time).to be_nil 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /spec/lib/astronomy_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Weather::Astronomy, :vcr do 4 | let(:response) { Weather.lookup 9848 } 5 | let(:astronomy) { response.astronomy } 6 | 7 | it 'should contain Time objects for sunrise and sunset' do 8 | expect(astronomy.sunrise).to be_a Time 9 | expect(astronomy.sunset).to be_a Time 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /spec/lib/wind_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Weather::Wind, :vcr do 4 | let(:response) { Weather.lookup 9848 } 5 | let(:wind) { response.wind } 6 | 7 | it 'should contain chill, direction, and speed as integers' do 8 | expect(wind.chill).to be_a Integer 9 | expect(wind.direction).to be_a Integer 10 | expect(wind.speed).to be_a Integer 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require "weather-api" 2 | 3 | require "rspec" 4 | require "webmock/rspec" 5 | require "vcr" 6 | 7 | VCR.configure do |config| 8 | config.cassette_library_dir = "spec/fixtures/cassettes" 9 | config.hook_into :webmock 10 | config.ignore_localhost = true 11 | config.default_cassette_options = { :record => :new_episodes } 12 | config.configure_rspec_metadata! 13 | end 14 | -------------------------------------------------------------------------------- /lib/weather-api/astronomy.rb: -------------------------------------------------------------------------------- 1 | module Weather 2 | class Astronomy 3 | # a Time object containing the sunrise time for a location 4 | attr_reader :sunrise 5 | 6 | # a Time object containing the sunset time for a location 7 | attr_reader :sunset 8 | 9 | def initialize(payload) 10 | @sunrise = Utils.parse_time payload[:sunrise] 11 | @sunset = Utils.parse_time payload[:sunset] 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/weather-api/utils.rb: -------------------------------------------------------------------------------- 1 | require 'chronic' 2 | 3 | module Weather 4 | class Utils 5 | 6 | # Attempts to convert passed text into a Time object 7 | # 8 | # Returns a Time object or nil 9 | def self.parse_time(text = '') 10 | if text == '' 11 | return nil 12 | end 13 | 14 | begin 15 | Time.parse text 16 | rescue ArgumentError 17 | Chronic.parse text 18 | end 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /lib/weather-api/location.rb: -------------------------------------------------------------------------------- 1 | module Weather 2 | class Location 3 | # the name of the city 4 | attr_reader :city 5 | 6 | # the name of the country 7 | attr_reader :country 8 | 9 | # name of the region, such as a state or province 10 | attr_reader :region 11 | 12 | def initialize(payload) 13 | @city = payload[:city].strip 14 | @country = payload[:country].strip 15 | @region = payload[:region].strip 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /lib/weather-api/wind.rb: -------------------------------------------------------------------------------- 1 | module Weather 2 | class Wind 3 | # the temperature, with wind chill factored in 4 | attr_reader :chill 5 | 6 | # the direction of the wind in degrees 7 | attr_reader :direction 8 | 9 | # the windspeed 10 | attr_reader :speed 11 | 12 | def initialize(payload) 13 | @chill = payload[:chill].to_i 14 | @direction = payload[:direction].to_i 15 | @speed = payload[:speed].to_i 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /spec/lib/condition_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Weather::Condition, :vcr do 4 | let(:response) { Weather.lookup 9848 } 5 | let(:condition) { response.condition } 6 | 7 | it 'should contain a weather condition code, a date, a temperature, and a description' do 8 | expect(condition.code).to be_a Integer 9 | expect(condition.date).to be_a Time 10 | expect(condition.temp).to be_a Integer 11 | expect(condition.text).to be_a String 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /spec/lib/atmosphere_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Weather::Atmosphere, :vcr do 4 | let(:response) { Weather.lookup 9848 } 5 | let(:atmosphere) { response.atmosphere } 6 | 7 | it 'should contain a string indicating barometric pressure' do 8 | expect(atmosphere.barometer).to be_a String 9 | end 10 | 11 | it 'should contain integers representing humidity and visibility' do 12 | expect(atmosphere.humidity).to be_a Integer 13 | expect(atmosphere.visibility).to be_a Integer 14 | end 15 | 16 | it 'should contain a float indicating atmospheric pressure' do 17 | expect(atmosphere.pressure).to be_a Float 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/weather-api/condition.rb: -------------------------------------------------------------------------------- 1 | module Weather 2 | class Condition 3 | # the weather condition code, detailed at http://developer.yahoo.com/weather 4 | attr_reader :code 5 | 6 | # the date and time associated with these conditions. 7 | attr_reader :date 8 | 9 | # the temperature of the location. 10 | attr_reader :temp 11 | 12 | # the brief prose text description of the weather conditions of the location. 13 | attr_reader :text 14 | 15 | def initialize(payload) 16 | @code = payload[:code].to_i 17 | @date = Utils.parse_time payload[:date] 18 | @temp = payload[:temp].to_i 19 | @text = payload[:text].strip 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /spec/lib/forecast_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Weather::Forecast, :vcr do 4 | let(:response) { Weather.lookup 9848 } 5 | let(:forecast) { response.forecasts[0] } 6 | 7 | it 'should have an associated date' do 8 | expect(forecast.date).to be_a Time 9 | end 10 | 11 | it 'should contain high and low forecasts' do 12 | expect(forecast.high).to be_a Integer 13 | expect(forecast.low).to be_a Integer 14 | end 15 | 16 | it 'should contain the name of the day associated with the forecast' do 17 | expect(forecast.day).to be_a String 18 | end 19 | 20 | it 'should have a weather condition code' do 21 | expect(forecast.code).to be_a Integer 22 | end 23 | 24 | it 'should have a brief description of the forecasted conditions' do 25 | expect(forecast.text).to be_a String 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /lib/weather-api/forecast.rb: -------------------------------------------------------------------------------- 1 | module Weather 2 | class Forecast 3 | # the brief name of the day associated with the forecast 4 | attr_reader :day 5 | 6 | # the date associated with the forecast. 7 | attr_reader :date 8 | 9 | # the low temperature forecasted. 10 | attr_reader :low 11 | 12 | # the high temperature forecasted. 13 | attr_reader :high 14 | 15 | # the brief prose text description of the forecasted weather conditions. 16 | attr_reader :text 17 | 18 | # the weather condition code, detailed at http://developer.yahoo.com/weather 19 | attr_reader :code 20 | 21 | def initialize(payload) 22 | @day = payload[:day].strip 23 | @date = Utils.parse_time payload[:date] 24 | @low = payload[:low].to_i 25 | @high = payload[:high].to_i 26 | @text = payload[:text] 27 | @code = payload[:code].to_i 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /lib/weather-api/units.rb: -------------------------------------------------------------------------------- 1 | module Weather 2 | class Units 3 | FAHRENHEIT = 'f' 4 | CELSIUS = 'c' 5 | 6 | # the unit in which temperature is measured 7 | # e.g. F for Fahrenheit, and C for Celsius 8 | attr_reader :temperature 9 | 10 | # the unit in which distance is measured 11 | # e.g. mi for miles, and km for kilometers 12 | attr_reader :distance 13 | 14 | # the unit in which pressure is measured 15 | # e.g in for inches, and cm for centimeters 16 | attr_reader :pressure 17 | 18 | # the unit in which speed is measured 19 | # e.g. mph for miles per hour, and kph for kilometers per hour 20 | attr_reader :speed 21 | 22 | def initialize(payload) 23 | @temperature = payload[:temperature].strip 24 | @distance = payload[:distance].strip 25 | @pressure = payload[:pressure].strip 26 | @speed = payload[:speed].strip 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /spec/lib/units_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Weather::Units do 4 | describe 'constants' do 5 | it 'should have constants for celsius and fahrenheit' do 6 | expect(Weather::Units::FAHRENHEIT).to eq 'f' 7 | expect(Weather::Units::CELSIUS).to eq 'c' 8 | end 9 | end 10 | 11 | describe 'defaults', :vcr do 12 | it 'should default to metric units' do 13 | response = Weather.lookup 9848 14 | 15 | expect(response.units.distance).to eq 'km' 16 | expect(response.units.pressure).to eq 'mb' 17 | expect(response.units.speed).to eq 'km/h' 18 | expect(response.units.temperature).to eq 'C' 19 | end 20 | 21 | it 'should switch to imperial if specified' do 22 | response = Weather.lookup 9848, Weather::Units::FAHRENHEIT 23 | 24 | expect(response.units.distance).to eq 'mi' 25 | expect(response.units.pressure).to eq 'in' 26 | expect(response.units.speed).to eq 'mph' 27 | expect(response.units.temperature).to eq 'F' 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Andrew Stewart 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /lib/weather-api/atmosphere.rb: -------------------------------------------------------------------------------- 1 | module Weather 2 | class Atmosphere 3 | class Barometer 4 | STEADY = 'steady' 5 | RISING = 'rising' 6 | FALLING = 'falling' 7 | 8 | # list of all possible barometer constants 9 | ALL = [STEADY, RISING, FALLING] 10 | end 11 | 12 | # air humidity 13 | attr_reader :humidity 14 | 15 | # visibility of the surroundings 16 | attr_reader :visibility 17 | 18 | # air pressure level 19 | attr_reader :pressure 20 | 21 | # barometer state, defined as one of the contants 22 | # in Weather::Atmosphere::Barometer 23 | attr_reader :barometer 24 | 25 | def initialize(payload) 26 | @humidity = payload[:humidity].to_i 27 | @visibility = payload[:visibility].to_i 28 | @pressure = payload[:pressure].to_f 29 | 30 | # map barometric pressure to appropriate constant 31 | @barometer = nil 32 | 33 | case payload[:rising].to_i 34 | when 0 then @barometer = Barometer::STEADY 35 | when 1 then @barometer = Barometer::RISING 36 | when 2 then @barometer = Barometer::FALLING 37 | end 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Weather-API 2 | 3 | A Ruby wrapper for the Yahoo! Weather XML RSS feed. 4 | 5 | ## Installation 6 | 7 | [sudo] gem install weather-api 8 | 9 | ## Description 10 | 11 | Weather-API provides an object-oriented interface to the Yahoo! Weather XML RSS 12 | feed service. 13 | 14 | Details on the service can be found [here](http://developer.yahoo.com/weather). 15 | 16 | ## Usage 17 | 18 | A simple example: 19 | 20 | require 'rubygems' 21 | require 'weather-api' 22 | 23 | # look up WOEID via http://weather.yahoo.com; enter location by city 24 | # name or zip and WOEID is at end of resulting page url. 25 | response = Weather.lookup(9830, Weather::Units::CELSIUS) 26 | 27 | print < 0.10.2" 21 | spec.add_dependency "map", "~> 6.6.0" 22 | spec.add_dependency "json" 23 | spec.add_development_dependency "rspec", "~> 3.5.0" 24 | spec.add_development_dependency "webmock", "~> 2.3.2" 25 | spec.add_development_dependency "rake", "~> 11.2.2" 26 | spec.add_development_dependency "vcr", "~> 3.0.3" 27 | end 28 | -------------------------------------------------------------------------------- /spec/lib/location_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Weather::Location, :vcr do 4 | it 'should contain city, country, and region as strings' do 5 | response = Weather.lookup 9848 6 | 7 | expect(response.location.city).to be_a String 8 | expect(response.location.city).to be_a String 9 | expect(response.location.region).to be_a String 10 | expect(response.location.country).to be_a String 11 | end 12 | 13 | it 'should be able to look up Seattle, WA' do 14 | response = Weather.lookup 2490383 15 | 16 | expect(response.location.city).to eq 'Seattle' 17 | expect(response.location.region).to eq 'WA' 18 | expect(response.location.country).to eq 'United States' 19 | end 20 | 21 | it 'should be able to look up Victoria, BC' do 22 | response = Weather.lookup 9848 23 | 24 | expect(response.location.city).to eq 'Victoria' 25 | expect(response.location.region).to eq 'BC' 26 | expect(response.location.country).to eq 'Canada' 27 | end 28 | 29 | it 'should be able to look up Nice, France' do 30 | response = Weather.lookup 614274 31 | 32 | expect(response.location.city).to eq 'Nice' 33 | expect(response.location.region).to eq "Provence-Alpes-Cote d'Azur" 34 | expect(response.location.country).to eq 'France' 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Response/should_return_a_RuntimeError_for_an_invalid_WOEID.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=8888888888%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;84bcc71f-5ff1-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:50 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Via: 40 | - http/1.1 a16.ue.gq1.yahoo.net (ApacheTrafficServer [cMsSf ]) 41 | Y-Trace: 42 | - BAEAQAAAAABbiqsDI0B96gAAAAAAAAAAU.wh_ofFiQAAAAAAAAAAAAAFOjwFm2zFAAU6PAWblwFAdRNtAAAAAA-- 43 | Transfer-Encoding: 44 | - chunked 45 | Connection: 46 | - keep-alive 47 | body: 48 | encoding: UTF-8 49 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:50Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"}}}}}' 50 | http_version: 51 | recorded_at: Wed, 17 Aug 2016 03:25:50 GMT 52 | recorded_with: VCR 3.0.3 53 | -------------------------------------------------------------------------------- /spec/lib/response_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Weather::Response, :vcr do 4 | let(:response) { Weather.lookup 9848 } 5 | let(:invalid_response) { Weather.lookup 8888888888 } 6 | 7 | it 'should contain a Weather::Astronomy object' do 8 | expect(response.astronomy).to be_a Weather::Astronomy 9 | end 10 | 11 | it 'should contain a Weather::Location object' do 12 | expect(response.location).to be_a Weather::Location 13 | end 14 | 15 | it 'should contain a Weather::Units object' do 16 | expect(response.units).to be_a Weather::Units 17 | end 18 | 19 | it 'should contain a Weather::Wind object' do 20 | expect(response.wind).to be_a Weather::Wind 21 | end 22 | 23 | it 'should contain a Weather::Atmosphere object' do 24 | expect(response.atmosphere).to be_a Weather::Atmosphere 25 | end 26 | 27 | it 'should contain a Weather::Condition object' do 28 | expect(response.condition).to be_a Weather::Condition 29 | end 30 | 31 | it 'should contain a collection of Weather::Forecast objects' do 32 | expect(response.forecasts[0]).to be_a Weather::Forecast 33 | end 34 | 35 | it 'should contain a Weather::Image object' do 36 | expect(response.image).to be_a Weather::Image 37 | end 38 | 39 | it 'should contain the WOEID of the request location and the requested URL' do 40 | expect(response.request_location).to eq 9848 41 | expect(response.request_url).to eq "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%3D9848%20and%20u%3D'c'&format=json" 42 | end 43 | 44 | it 'should return a RuntimeError for an invalid WOEID' do 45 | expect { invalid_response.location }.to raise_error(RuntimeError, /Failed to get weather/i) 46 | end 47 | 48 | it 'should contain a HTML description summarizing weather conditions' do 49 | expect(response.description).to be_a String 50 | end 51 | 52 | it 'should contain a String title' do 53 | expect(response.title).to be_a String 54 | end 55 | 56 | it 'should contain latitude and longitude in floats' do 57 | expect(response.latitude).to be_a Float 58 | expect(response.longitude).to be_a Float 59 | end 60 | end 61 | -------------------------------------------------------------------------------- /lib/weather-api/response.rb: -------------------------------------------------------------------------------- 1 | module Weather 2 | class Response 3 | # a Weather::Astronomy object containing sunrise and sunset 4 | # information for the requested location 5 | attr_reader :astronomy 6 | 7 | # a Weather::Location object containing the geographical 8 | # names of the requested location 9 | attr_reader :location 10 | 11 | # a Weather::Units object containig the units corresponding 12 | # to the information contained in the response 13 | attr_reader :units 14 | 15 | # a Weather::Wind object containing the wind information 16 | # for the requested location 17 | attr_reader :wind 18 | 19 | # a Weather::Atmosphere object containing the atmosphere 20 | # information for the requested location 21 | attr_reader :atmosphere 22 | 23 | # a Weather::Condition object detailing the current 24 | # conditions of the requested location 25 | attr_reader :condition 26 | 27 | # a collection of Weather::Forecast objects containing 28 | # high-level forecasted weather for upcoming days 29 | attr_reader :forecasts 30 | 31 | # the HTML summarizing current weather conditions for 32 | # the requested location 33 | attr_reader :description 34 | 35 | # a Weather::Image object containing an image icon 36 | # representing the current weather for the requested location 37 | attr_reader :image 38 | 39 | # the latitude for the requested location 40 | attr_reader :latitude 41 | 42 | # the longitude for the requested location 43 | attr_reader :longitude 44 | 45 | # the location string initially requested of the service. 46 | attr_reader :request_location 47 | 48 | # the url with which the Yahoo! Weather service was 49 | # accessed to build the response 50 | attr_reader :request_url 51 | 52 | # the title of the weather information for the requested location 53 | attr_reader :title 54 | 55 | def initialize(request_location, request_url, doc) 56 | # save the request params 57 | @request_location = request_location 58 | @request_url = request_url 59 | 60 | @astronomy = Astronomy.new doc[:astronomy] 61 | @location = Location.new doc[:location] 62 | @units = Units.new doc[:units] 63 | @wind = Wind.new doc[:wind] 64 | @atmosphere = Atmosphere.new doc[:atmosphere] 65 | @image = Image.new doc[:item][:description] 66 | 67 | @forecasts = [] 68 | 69 | @condition = Condition.new doc[:item][:condition] 70 | 71 | doc[:item][:forecast].each do |forecast| 72 | @forecasts << Forecast.new(forecast) 73 | end 74 | 75 | @latitude = doc[:item][:lat].to_f 76 | @longitude = doc[:item][:long].to_f 77 | @title = doc[:item][:title].strip 78 | @description = doc[:item][:description].strip 79 | end 80 | end 81 | end 82 | -------------------------------------------------------------------------------- /lib/weather-api.rb: -------------------------------------------------------------------------------- 1 | require 'net/http' 2 | require 'json' 3 | require 'map' 4 | 5 | require 'weather-api/astronomy' 6 | require 'weather-api/atmosphere' 7 | require 'weather-api/condition' 8 | require 'weather-api/forecast' 9 | require 'weather-api/image' 10 | require 'weather-api/location' 11 | require 'weather-api/response' 12 | require 'weather-api/units' 13 | require 'weather-api/utils' 14 | require 'weather-api/version' 15 | require 'weather-api/wind' 16 | 17 | module Weather 18 | class << self 19 | # Yahoo! Weather info endpoint 20 | ROOT = "http://query.yahooapis.com/v1/public/yql" 21 | 22 | # Public: Looks up current weather information using WOEID 23 | # 24 | # woeid - Int - Where On Earth IDentifier -- unique ID for 25 | # location to get weather data for. To find 26 | # a WOEID, refer to Yahoo!'s documentation 27 | # at http://developer.yahoo.com/weather/ 28 | # 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 35 | # 36 | # Returns a Weather::Response object containing forecast 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" 43 | 44 | doc = get_response url 45 | Response.new woeid, url, doc 46 | end 47 | 48 | # Public: Looks up current weather information using a location string 49 | # 50 | # location - String - A location name. 'City, state, country' 51 | # Examples: Nome, AK 52 | # San Francisco, CA, USA 53 | # Berlin, Germany 54 | # toronto, ca 55 | # 56 | # unit - system of measurement to use. Two acceptable inputs: 57 | # 'c' - Celsius/Metric measurements 58 | # 'f' - Fahrenheit/Imperial measurements. 59 | # 60 | # To make this easier, you can use the Weather::Units::FAHRENHEIT and 61 | # Weather::Units::CELSIUS constants. Defaults to Celsius 62 | # 63 | # Returns a Weather::Response object containing forecast 64 | def lookup_by_location(location, unit = Units::CELSIUS) 65 | acceptable_units = [Units::CELSIUS, Units::FAHRENHEIT] 66 | unit = Units::CELSIUS unless acceptable_units.include?(unit) 67 | 68 | # per the documentation here: https://developer.yahoo.com/weather/ 69 | # can look up the woeid via geo places api from location 70 | url = ROOT + "?q=select * from weather.forecast where woeid in (select woeid from geo.places(1) where text='#{location}') and u='#{unit}'&format=json" 71 | url = URI.escape(url) 72 | 73 | doc = get_response url 74 | Response.new location, url, doc 75 | end 76 | 77 | private 78 | def get_response url 79 | begin 80 | response = Net::HTTP.get_response(URI.parse url).body.to_s 81 | rescue => e 82 | raise "Failed to get weather [url=#{url}, e=#{e}]." 83 | end 84 | 85 | response = Map.new(JSON.parse(response))[:query][:results][:channel] 86 | 87 | if response.nil? || !response.respond_to?(:title) || response.title.match(/error/i) 88 | raise "Failed to get weather [url=#{url}]." 89 | end 90 | 91 | response 92 | end 93 | end 94 | end 95 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Image/should_contain_a_string_for_the_image_url.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aae3e7d8-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:49 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Transfer-Encoding: 40 | - chunked 41 | Connection: 42 | - keep-alive 43 | body: 44 | encoding: UTF-8 45 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:49Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 46 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 47 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 48 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 49 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 50 | am","sunset":"8:24 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 51 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 52 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 53 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 54 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 55 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 56 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 57 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 58 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 59 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 60 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 61 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 62 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 63 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 66 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 67 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 68 | 17\n
\n
\nFull 69 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 71 | http_version: 72 | recorded_at: Wed, 17 Aug 2016 03:25:49 GMT 73 | recorded_with: VCR 3.0.3 74 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Location/should_be_able_to_look_up_Victoria_BC.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;7217925e-63fa-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:49 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Transfer-Encoding: 40 | - chunked 41 | Connection: 42 | - keep-alive 43 | body: 44 | encoding: UTF-8 45 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:49Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 46 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 47 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 48 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 49 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 50 | am","sunset":"8:24 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 51 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 52 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 53 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 54 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 55 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 56 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 57 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 58 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 59 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 60 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 61 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 62 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 63 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 66 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 67 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 68 | 17\n
\n
\nFull 69 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 71 | http_version: 72 | recorded_at: Wed, 17 Aug 2016 03:25:49 GMT 73 | recorded_with: VCR 3.0.3 74 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Response/should_contain_a_Weather_Units_object.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aaf4fe09-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:49 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Transfer-Encoding: 40 | - chunked 41 | Connection: 42 | - keep-alive 43 | body: 44 | encoding: UTF-8 45 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:49Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 46 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 47 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 48 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 49 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 50 | am","sunset":"8:24 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 51 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 52 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 53 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 54 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 55 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 56 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 57 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 58 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 59 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 60 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 61 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 62 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 63 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 66 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 67 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 68 | 17\n
\n
\nFull 69 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 71 | http_version: 72 | recorded_at: Wed, 17 Aug 2016 03:25:49 GMT 73 | recorded_with: VCR 3.0.3 74 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Units/defaults/should_switch_to_imperial_if_specified.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27f%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aae435fe-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:50 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Transfer-Encoding: 40 | - chunked 41 | Connection: 42 | - keep-alive 43 | body: 44 | encoding: UTF-8 45 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:50Z","lang":"en-US","results":{"channel":{"units":{"distance":"mi","pressure":"in","speed":"mph","temperature":"F"},"title":"Yahoo! 46 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 47 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 48 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 49 | BC"},"wind":{"chill":"64","direction":"235","speed":"18"},"atmosphere":{"humidity":"72","pressure":"1014.0","rising":"0","visibility":"16.1"},"astronomy":{"sunrise":"6:10 50 | am","sunset":"8:24 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 51 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 52 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 53 | 07:00 PM PDT","temp":"65","text":"Sunny"},"forecast":[{"code":"32","date":"16 54 | Aug 2016","day":"Tue","high":"65","low":"61","text":"Sunny"},{"code":"32","date":"17 55 | Aug 2016","day":"Wed","high":"65","low":"59","text":"Sunny"},{"code":"32","date":"18 56 | Aug 2016","day":"Thu","high":"79","low":"62","text":"Sunny"},{"code":"32","date":"19 57 | Aug 2016","day":"Fri","high":"74","low":"67","text":"Sunny"},{"code":"32","date":"20 58 | Aug 2016","day":"Sat","high":"72","low":"63","text":"Sunny"},{"code":"32","date":"21 59 | Aug 2016","day":"Sun","high":"67","low":"61","text":"Sunny"},{"code":"34","date":"22 60 | Aug 2016","day":"Mon","high":"64","low":"59","text":"Mostly Sunny"},{"code":"30","date":"23 61 | Aug 2016","day":"Tue","high":"65","low":"61","text":"Partly Cloudy"},{"code":"34","date":"24 62 | Aug 2016","day":"Wed","high":"70","low":"62","text":"Mostly Sunny"},{"code":"34","date":"25 63 | Aug 2016","day":"Thu","high":"74","low":"65","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 65Low: 66 | 61\n
Wed - Sunny. High: 65Low: 59\n
Thu - Sunny. High: 79Low: 67 | 62\n
Fri - Sunny. High: 74Low: 67\n
Sat - Sunny. High: 72Low: 68 | 63\n
\n
\nFull 69 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 71 | http_version: 72 | recorded_at: Wed, 17 Aug 2016 03:25:50 GMT 73 | recorded_with: VCR 3.0.3 74 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Response/should_contain_latitude_and_longitude_in_floats.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aae6a61c-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:50 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Transfer-Encoding: 40 | - chunked 41 | Connection: 42 | - keep-alive 43 | body: 44 | encoding: UTF-8 45 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:50Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 46 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 47 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 48 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 49 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 50 | am","sunset":"8:24 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 51 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 52 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 53 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 54 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 55 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 56 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 57 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 58 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 59 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 60 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 61 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 62 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 63 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 66 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 67 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 68 | 17\n
\n
\nFull 69 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 71 | http_version: 72 | recorded_at: Wed, 17 Aug 2016 03:25:50 GMT 73 | recorded_with: VCR 3.0.3 74 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Atmosphere/should_contain_integers_representing_humidity_and_visibility.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aae2af4d-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:48 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Transfer-Encoding: 40 | - chunked 41 | Connection: 42 | - keep-alive 43 | body: 44 | encoding: UTF-8 45 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:48Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 46 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 47 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 48 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 49 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 50 | am","sunset":"8:24 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 51 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 52 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 53 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 54 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 55 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 56 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 57 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 58 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 59 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 60 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 61 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 62 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 63 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 66 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 67 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 68 | 17\n
\n
\nFull 69 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 71 | http_version: 72 | recorded_at: Wed, 17 Aug 2016 03:25:48 GMT 73 | recorded_with: VCR 3.0.3 74 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Forecast/should_have_a_brief_description_of_the_forecasted_conditions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aae6cd2f-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:49 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Transfer-Encoding: 40 | - chunked 41 | Connection: 42 | - keep-alive 43 | body: 44 | encoding: UTF-8 45 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:49Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 46 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 47 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 48 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 49 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 50 | am","sunset":"8:24 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 51 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 52 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 53 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 54 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 55 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 56 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 57 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 58 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 59 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 60 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 61 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 62 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 63 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 66 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 67 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 68 | 17\n
\n
\nFull 69 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 71 | http_version: 72 | recorded_at: Wed, 17 Aug 2016 03:25:49 GMT 73 | recorded_with: VCR 3.0.3 74 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Response/should_contain_a_HTML_description_summarizing_weather_conditions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aae5bbb0-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:50 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Transfer-Encoding: 40 | - chunked 41 | Connection: 42 | - keep-alive 43 | body: 44 | encoding: UTF-8 45 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:50Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 46 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 47 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 48 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 49 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 50 | am","sunset":"8:24 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 51 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 52 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 53 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 54 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 55 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 56 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 57 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 58 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 59 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 60 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 61 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 62 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 63 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 66 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 67 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 68 | 17\n
\n
\nFull 69 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 71 | http_version: 72 | recorded_at: Wed, 17 Aug 2016 03:25:50 GMT 73 | recorded_with: VCR 3.0.3 74 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Forecast/should_have_an_associated_date.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aae6f440-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:48 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Via: 40 | - http/1.1 a15.ue.gq1.yahoo.net (ApacheTrafficServer [cMsSf ]) 41 | Y-Trace: 42 | - BAEAQAAAAACH.7tMKWjMAQAAAAAAAAAAvVrk5Fi531AAAAAAAAAAAAAFOjwFg1KnAAU6PAWDemBgfU9DAAAAAA-- 43 | Transfer-Encoding: 44 | - chunked 45 | Connection: 46 | - keep-alive 47 | body: 48 | encoding: UTF-8 49 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:48Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 50 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 51 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 52 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 53 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 54 | am","sunset":"8:24 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 55 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 56 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 57 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 58 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 59 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 60 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 61 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 62 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 63 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 64 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 65 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 66 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 67 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 70 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 71 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 72 | 17\n
\n
\nFull 73 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 75 | http_version: 76 | recorded_at: Wed, 17 Aug 2016 03:25:48 GMT 77 | recorded_with: VCR 3.0.3 78 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Response/should_contain_a_String_title.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aaf720eb-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:50 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Via: 40 | - http/1.1 a20.ue.gq1.yahoo.net (ApacheTrafficServer [cMsSf ]) 41 | Y-Trace: 42 | - BAEAQAAAAABLUaVpTflCGwAAAAAAAAAAtZ3BZBEpIBwAAAAAAAAAAAAFOjwFnQKoAAU6PAWdMDxv1GQZAAAAAA-- 43 | Transfer-Encoding: 44 | - chunked 45 | Connection: 46 | - keep-alive 47 | body: 48 | encoding: UTF-8 49 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:50Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 50 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 51 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 52 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 53 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 54 | am","sunset":"8:24 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 55 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 56 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 57 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 58 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 59 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 60 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 61 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 62 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 63 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 64 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 65 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 66 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 67 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 70 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 71 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 72 | 17\n
\n
\nFull 73 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 75 | http_version: 76 | recorded_at: Wed, 17 Aug 2016 03:25:50 GMT 77 | recorded_with: VCR 3.0.3 78 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Forecast/should_contain_high_and_low_forecasts.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;d9b169c6-63d7-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:48 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Via: 40 | - http/1.1 a07.ue.gq1.yahoo.net (ApacheTrafficServer [cMsSf ]) 41 | Y-Trace: 42 | - BAEAQAAAAAA_N7quycTzfwAAAAAAAAAA3HlWeCPJqfMAAAAAAAAAAAAFOjwFhCjwAAU6PAWEUtg46q3wAAAAAA-- 43 | Transfer-Encoding: 44 | - chunked 45 | Connection: 46 | - keep-alive 47 | body: 48 | encoding: UTF-8 49 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:48Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 50 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 51 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 52 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 53 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 54 | am","sunset":"8:24 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 55 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 56 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 57 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 58 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 59 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 60 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 61 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 62 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 63 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 64 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 65 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 66 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 67 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 70 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 71 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 72 | 17\n
\n
\nFull 73 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 75 | http_version: 76 | recorded_at: Wed, 17 Aug 2016 03:25:48 GMT 77 | recorded_with: VCR 3.0.3 78 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Forecast/should_have_a_weather_condition_code.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aae52068-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:48 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Via: 40 | - http/1.1 a18.ue.gq1.yahoo.net (ApacheTrafficServer [cMsSf ]) 41 | Y-Trace: 42 | - BAEAQAAAAAA689I874TLeAAAAAAAAAAANJbo29Fpv_EAAAAAAAAAAAAFOjwFhdIHAAU6PAWF_rYl9ovSAAAAAA-- 43 | Transfer-Encoding: 44 | - chunked 45 | Connection: 46 | - keep-alive 47 | body: 48 | encoding: UTF-8 49 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:48Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 50 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 51 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 52 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 53 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 54 | am","sunset":"8:24 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 55 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 56 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 57 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 58 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 59 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 60 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 61 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 62 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 63 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 64 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 65 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 66 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 67 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 70 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 71 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 72 | 17\n
\n
\nFull 73 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 75 | http_version: 76 | recorded_at: Wed, 17 Aug 2016 03:25:49 GMT 77 | recorded_with: VCR 3.0.3 78 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Response/should_contain_a_Weather_Image_object.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aae2af4d-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:49 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Via: 40 | - http/1.1 a13.ue.gq1.yahoo.net (ApacheTrafficServer [cMsSf ]) 41 | Y-Trace: 42 | - BAEAQAAAAAAYAm0eByqKFQAAAAAAAAAAJJfmBmMaNo0AAAAAAAAAAAAFOjwFl8KHAAU6PAWX8l5rbRxaAAAAAA-- 43 | Transfer-Encoding: 44 | - chunked 45 | Connection: 46 | - keep-alive 47 | body: 48 | encoding: UTF-8 49 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:49Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 50 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 51 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 52 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 53 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 54 | am","sunset":"8:24 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 55 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 56 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 57 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 58 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 59 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 60 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 61 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 62 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 63 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 64 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 65 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 66 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 67 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 70 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 71 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 72 | 17\n
\n
\nFull 73 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 75 | http_version: 76 | recorded_at: Wed, 17 Aug 2016 03:25:49 GMT 77 | recorded_with: VCR 3.0.3 78 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Response/should_contain_a_Weather_Wind_object.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aae40eeb-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:49 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Via: 40 | - http/1.1 a18.ue.gq1.yahoo.net (ApacheTrafficServer [cMsSf ]) 41 | Y-Trace: 42 | - BAEAQAAAAAB4WfFrMHYXXgAAAAAAAAAANJbo29Fpv_EAAAAAAAAAAAAFOjwFlDshAAU6PAWUbqF2895AAAAAAA-- 43 | Transfer-Encoding: 44 | - chunked 45 | Connection: 46 | - keep-alive 47 | body: 48 | encoding: UTF-8 49 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:49Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 50 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 51 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 52 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 53 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 54 | am","sunset":"8:24 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 55 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 56 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 57 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 58 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 59 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 60 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 61 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 62 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 63 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 64 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 65 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 66 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 67 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 70 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 71 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 72 | 17\n
\n
\nFull 73 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 75 | http_version: 76 | recorded_at: Wed, 17 Aug 2016 03:25:49 GMT 77 | recorded_with: VCR 3.0.3 78 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Units/defaults/should_default_to_metric_units.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aae23a18-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:50 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Via: 40 | - http/1.1 a09.ue.gq1.yahoo.net (ApacheTrafficServer [cMsSf ]) 41 | Y-Trace: 42 | - BAEAQAAAAAA2jtxDKpchOAAAAAAAAAAAkUXVtBzY_BoAAAAAAAAAAAAFOjwFnq2rAAU6PAWe3UrbMsyhAAAAAA-- 43 | Transfer-Encoding: 44 | - chunked 45 | Connection: 46 | - keep-alive 47 | body: 48 | encoding: UTF-8 49 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:50Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 50 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 51 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 52 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 53 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 54 | am","sunset":"8:24 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 55 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 56 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 57 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 58 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 59 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 60 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 61 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 62 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 63 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 64 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 65 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 66 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 67 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 70 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 71 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 72 | 17\n
\n
\nFull 73 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 75 | http_version: 76 | recorded_at: Wed, 17 Aug 2016 03:25:50 GMT 77 | recorded_with: VCR 3.0.3 78 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Response/should_contain_a_Weather_Astronomy_object.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aae5959e-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:49 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Via: 40 | - http/1.1 a11.ue.gq1.yahoo.net (ApacheTrafficServer [cMsSf ]) 41 | Y-Trace: 42 | - BAEAQAAAAAB7KrthiIJCuAAAAAAAAAAAu_PpFM1p83AAAAAAAAAAAAAFOjwFkbGnAAU6PAWR3tEErALYAAAAAA-- 43 | Transfer-Encoding: 44 | - chunked 45 | Connection: 46 | - keep-alive 47 | body: 48 | encoding: UTF-8 49 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:49Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 50 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 51 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 52 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 53 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 54 | am","sunset":"8:24 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 55 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 56 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 57 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 58 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 59 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 60 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 61 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 62 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 63 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 64 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 65 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 66 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 67 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 70 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 71 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 72 | 17\n
\n
\nFull 73 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 75 | http_version: 76 | recorded_at: Wed, 17 Aug 2016 03:25:49 GMT 77 | recorded_with: VCR 3.0.3 78 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Response/should_contain_a_Weather_Atmosphere_object.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aae2883b-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:49 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Via: 40 | - http/1.1 a01.ue.gq1.yahoo.net (ApacheTrafficServer [cMsSf ]) 41 | Y-Trace: 42 | - BAEAQAAAAABqhwUdEflKzQAAAAAAAAAAMDLMEhai3BgAAAAAAAAAAAAFOjwFlR6DAAU6PAWVStXmUw.yAAAAAA-- 43 | Transfer-Encoding: 44 | - chunked 45 | Connection: 46 | - keep-alive 47 | body: 48 | encoding: UTF-8 49 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:49Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 50 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 51 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 52 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 53 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 54 | am","sunset":"8:24 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 55 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 56 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 57 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 58 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 59 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 60 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 61 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 62 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 63 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 64 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 65 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 66 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 67 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 70 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 71 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 72 | 17\n
\n
\nFull 73 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 75 | http_version: 76 | recorded_at: Wed, 17 Aug 2016 03:25:49 GMT 77 | recorded_with: VCR 3.0.3 78 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Response/should_contain_a_Weather_Condition_object.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aae56e8d-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:49 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Via: 40 | - http/1.1 a20.ue.gq1.yahoo.net (ApacheTrafficServer [cMsSf ]) 41 | Y-Trace: 42 | - BAEAQAAAAABp_d69aWvRdAAAAAAAAAAAtZ3BZBEpIBwAAAAAAAAAAAAFOjwFlftZAAU6PAWWLl9d7fOuAAAAAA-- 43 | Transfer-Encoding: 44 | - chunked 45 | Connection: 46 | - keep-alive 47 | body: 48 | encoding: UTF-8 49 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:49Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 50 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 51 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 52 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 53 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 54 | am","sunset":"8:24 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 55 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 56 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 57 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 58 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 59 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 60 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 61 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 62 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 63 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 64 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 65 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 66 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 67 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 70 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 71 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 72 | 17\n
\n
\nFull 73 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 75 | http_version: 76 | recorded_at: Wed, 17 Aug 2016 03:25:49 GMT 77 | recorded_with: VCR 3.0.3 78 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Response/should_contain_a_Weather_Location_object.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aaf747fc-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:49 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Via: 40 | - http/1.1 a06.ue.gq1.yahoo.net (ApacheTrafficServer [cMsSf ]) 41 | Y-Trace: 42 | - BAEAQAAAAADazy3P63o7ewAAAAAAAAAAWhE1P8QzujQAAAAAAAAAAAAFOjwFkowHAAU6PAWSuHebs2S7AAAAAA-- 43 | Transfer-Encoding: 44 | - chunked 45 | Connection: 46 | - keep-alive 47 | body: 48 | encoding: UTF-8 49 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:49Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 50 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 51 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 52 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 53 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 54 | am","sunset":"8:24 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 55 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 56 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 57 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 58 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 59 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 60 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 61 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 62 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 63 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 64 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 65 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 66 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 67 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 70 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 71 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 72 | 17\n
\n
\nFull 73 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 75 | http_version: 76 | recorded_at: Wed, 17 Aug 2016 03:25:49 GMT 77 | recorded_with: VCR 3.0.3 78 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Astronomy/should_contain_Time_objects_for_sunrise_and_sunset.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aae609d5-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:48 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Via: 40 | - http/1.1 a20.ue.gq1.yahoo.net (ApacheTrafficServer [cMsSf ]) 41 | Y-Trace: 42 | - BAEAQAAAAACtE_zvKikXzgAAAAAAAAAAtZ3BZBEpIBwAAAAAAAAAAAAFOjwFfzbUAAU6PAV_YLwPa3wXAAAAAA-- 43 | Transfer-Encoding: 44 | - chunked 45 | Connection: 46 | - keep-alive 47 | body: 48 | encoding: UTF-8 49 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:48Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 50 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 51 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 52 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 53 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 54 | am","sunset":"8:24 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 55 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 56 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 57 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 58 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 59 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 60 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 61 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 62 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 63 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 64 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 65 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 66 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 67 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 70 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 71 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 72 | 17\n
\n
\nFull 73 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 75 | http_version: 76 | recorded_at: Wed, 17 Aug 2016 03:25:48 GMT 77 | recorded_with: VCR 3.0.3 78 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Location/should_be_able_to_look_up_Seattle_WA.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=2490383%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aae52068-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:49 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Via: 40 | - http/1.1 a05.ue.gq1.yahoo.net (ApacheTrafficServer [cMsSf ]) 41 | Y-Trace: 42 | - BAEAQAAAAAC2PeSy2Vn6iAAAAAAAAAAAAF8crJ4ye_cAAAAAAAAAAAAFOjwFjv90AAU6PAWPKJtK_Ez9AAAAAA-- 43 | Transfer-Encoding: 44 | - chunked 45 | Connection: 46 | - keep-alive 47 | body: 48 | encoding: UTF-8 49 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:49Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 50 | Weather - Seattle, WA, US","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-2490383/","description":"Yahoo! 51 | Weather for Seattle, WA, US","language":"en-us","lastBuildDate":"Tue, 16 Aug 52 | 2016 08:25 PM PDT","ttl":"60","location":{"city":"Seattle","country":"United 53 | States","region":" WA"},"wind":{"chill":"77","direction":"0","speed":"22.53"},"atmosphere":{"humidity":"42","pressure":"34371.86","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:8 54 | am","sunset":"8:18 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 55 | for Seattle, WA, US at 07:00 PM PDT","lat":"47.603561","long":"-122.329437","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-2490383/","pubDate":"Tue, 56 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 57 | 07:00 PM PDT","temp":"25","text":"Sunny"},"forecast":[{"code":"32","date":"16 58 | Aug 2016","day":"Tue","high":"25","low":"15","text":"Sunny"},{"code":"32","date":"17 59 | Aug 2016","day":"Wed","high":"23","low":"15","text":"Sunny"},{"code":"32","date":"18 60 | Aug 2016","day":"Thu","high":"27","low":"17","text":"Sunny"},{"code":"32","date":"19 61 | Aug 2016","day":"Fri","high":"28","low":"17","text":"Sunny"},{"code":"32","date":"20 62 | Aug 2016","day":"Sat","high":"28","low":"17","text":"Sunny"},{"code":"32","date":"21 63 | Aug 2016","day":"Sun","high":"31","low":"17","text":"Sunny"},{"code":"34","date":"22 64 | Aug 2016","day":"Mon","high":"23","low":"15","text":"Mostly Sunny"},{"code":"34","date":"23 65 | Aug 2016","day":"Tue","high":"23","low":"15","text":"Mostly Sunny"},{"code":"34","date":"24 66 | Aug 2016","day":"Wed","high":"23","low":"15","text":"Mostly Sunny"},{"code":"34","date":"25 67 | Aug 2016","day":"Thu","high":"24","low":"16","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 25Low: 70 | 15\n
Wed - Sunny. High: 23Low: 15\n
Thu - Sunny. High: 27Low: 71 | 17\n
Fri - Sunny. High: 28Low: 17\n
Sat - Sunny. High: 28Low: 72 | 17\n
\n
\nFull 73 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 75 | http_version: 76 | recorded_at: Wed, 17 Aug 2016 03:25:49 GMT 77 | recorded_with: VCR 3.0.3 78 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Location/should_contain_city_country_and_region_as_strings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aae609d5-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:49 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Via: 40 | - http/1.1 a01.ue.gq1.yahoo.net (ApacheTrafficServer [cMsSf ]) 41 | Y-Trace: 42 | - BAEAQAAAAAAC_SVOWJ9tnAAAAAAAAAAAMDLMEhai3BgAAAAAAAAAAAAFOjwFjiACAAU6PAWOVTPQK9IXAAAAAA-- 43 | Transfer-Encoding: 44 | - chunked 45 | Connection: 46 | - keep-alive 47 | body: 48 | encoding: UTF-8 49 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:49Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 50 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 51 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 52 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 53 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 54 | am","sunset":"8:24 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 55 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 56 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 57 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 58 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 59 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 60 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 61 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 62 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 63 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 64 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 65 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 66 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 67 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 70 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 71 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 72 | 17\n
\n
\nFull 73 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 75 | http_version: 76 | recorded_at: Wed, 17 Aug 2016 03:25:49 GMT 77 | recorded_with: VCR 3.0.3 78 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Wind/should_contain_chill_direction_and_speed_as_integers.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aae5bbb0-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:50 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Via: 40 | - http/1.1 a02.ue.gq1.yahoo.net (ApacheTrafficServer [cMsSf ]) 41 | Y-Trace: 42 | - BAEAQAAAAAApLimI6vmlUwAAAAAAAAAAC5i34aTXpYIAAAAAAAAAAAAFOjwFoHWGAAU6PAWgo018wUvaAAAAAA-- 43 | Transfer-Encoding: 44 | - chunked 45 | Connection: 46 | - keep-alive 47 | body: 48 | encoding: UTF-8 49 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:50Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 50 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 51 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 52 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 53 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 54 | am","sunset":"8:24 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 55 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 56 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 57 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 58 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 59 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 60 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 61 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 62 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 63 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 64 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 65 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 66 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 67 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 70 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 71 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 72 | 17\n
\n
\nFull 73 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 75 | http_version: 76 | recorded_at: Wed, 17 Aug 2016 03:25:50 GMT 77 | recorded_with: VCR 3.0.3 78 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Atmosphere/should_contain_a_float_indicating_atmospheric_pressure.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;4da42dc7-5f26-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:48 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Via: 40 | - http/1.1 a17.ue.gq1.yahoo.net (ApacheTrafficServer [cMsSf ]) 41 | Y-Trace: 42 | - BAEAQAAAAABzQMndv.jdoQAAAAAAAAAAPNl_m5lvGPUAAAAAAAAAAAAFOjwFgb_iAAU6PAWB56aBcyVaAAAAAA-- 43 | Transfer-Encoding: 44 | - chunked 45 | Connection: 46 | - keep-alive 47 | body: 48 | encoding: UTF-8 49 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:48Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 50 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 51 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 52 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 53 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 54 | am","sunset":"8:24 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 55 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 56 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 57 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 58 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 59 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 60 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 61 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 62 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 63 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 64 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 65 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 66 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 67 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 70 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 71 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 72 | 17\n
\n
\nFull 73 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 75 | http_version: 76 | recorded_at: Wed, 17 Aug 2016 03:25:48 GMT 77 | recorded_with: VCR 3.0.3 78 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Atmosphere/should_contain_a_string_indicating_barometric_pressure.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aafffa8f-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:48 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Via: 40 | - http/1.1 a01.ue.gq1.yahoo.net (ApacheTrafficServer [cMsSf ]) 41 | Y-Trace: 42 | - BAEAQAAAAADbwfGJ4dg0DgAAAAAAAAAAMDLMEhai3BgAAAAAAAAAAAAFOjwFgDnjAAU6PAWAYW_iLlRqAAAAAA-- 43 | Transfer-Encoding: 44 | - chunked 45 | Connection: 46 | - keep-alive 47 | body: 48 | encoding: UTF-8 49 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:48Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 50 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 51 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 52 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 53 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 54 | am","sunset":"8:24 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 55 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 56 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 57 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 58 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 59 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 60 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 61 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 62 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 63 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 64 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 65 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 66 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 67 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 70 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 71 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 72 | 17\n
\n
\nFull 73 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 75 | http_version: 76 | recorded_at: Wed, 17 Aug 2016 03:25:48 GMT 77 | recorded_with: VCR 3.0.3 78 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Response/should_contain_a_collection_of_Weather_Forecast_objects.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aae609d5-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:49 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Via: 40 | - http/1.1 a13.ue.gq1.yahoo.net (ApacheTrafficServer [cMsSf ]) 41 | Y-Trace: 42 | - BAEAQAAAAAB91nQXn9GY0gAAAAAAAAAAJJfmBmMaNo0AAAAAAAAAAAAFOjwFluWkAAU6PAWXEVKy7LasAAAAAA-- 43 | Transfer-Encoding: 44 | - chunked 45 | Connection: 46 | - keep-alive 47 | body: 48 | encoding: UTF-8 49 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:49Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 50 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 51 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 52 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 53 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 54 | am","sunset":"8:24 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 55 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 56 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 57 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 58 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 59 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 60 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 61 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 62 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 63 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 64 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 65 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 66 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 67 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 70 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 71 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 72 | 17\n
\n
\nFull 73 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 75 | http_version: 76 | recorded_at: Wed, 17 Aug 2016 03:25:49 GMT 77 | recorded_with: VCR 3.0.3 78 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Forecast/should_contain_the_name_of_the_day_associated_with_the_forecast.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aae48422-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:48 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Via: 40 | - http/1.1 a09.ue.gq1.yahoo.net (ApacheTrafficServer [cMsSf ]) 41 | Y-Trace: 42 | - BAEAQAAAAACT7N_lM_o.GgAAAAAAAAAAkUXVtBzY_BoAAAAAAAAAAAAFOjwFhP7YAAU6PAWFKyhHs5ZLAAAAAA-- 43 | Transfer-Encoding: 44 | - chunked 45 | Connection: 46 | - keep-alive 47 | body: 48 | encoding: UTF-8 49 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:48Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 50 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 51 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 52 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 53 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 54 | am","sunset":"8:24 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 55 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 56 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 57 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 58 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 59 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 60 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 61 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 62 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 63 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 64 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 65 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 66 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 67 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 70 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 71 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 72 | 17\n
\n
\nFull 73 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 75 | http_version: 76 | recorded_at: Wed, 17 Aug 2016 03:25:48 GMT 77 | recorded_with: VCR 3.0.3 78 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Response/should_contain_the_WOEID_of_the_request_location_and_the_requested_URL.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aae4ab33-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:50 GMT 35 | Age: 36 | - '3' 37 | Server: 38 | - ATS 39 | Via: 40 | - http/1.1 a16.ue.gq1.yahoo.net (ApacheTrafficServer [cMsSf ]) 41 | Y-Trace: 42 | - BAEAQAAAAAD0pXDz.hWTjwAAAAAAAAAAU.wh_ofFiQAAAAAAAAAAAAAFOjwFmJiSAAU6PAWavt6J8ODeAAAAAA-- 43 | Transfer-Encoding: 44 | - chunked 45 | Connection: 46 | - keep-alive 47 | body: 48 | encoding: UTF-8 49 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:50Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 50 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 51 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 52 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 53 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 54 | am","sunset":"8:24 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 55 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 56 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 57 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 58 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 59 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 60 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 61 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 62 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 63 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 64 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 65 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 66 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 67 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 70 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 71 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 72 | 17\n
\n
\nFull 73 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 75 | http_version: 76 | recorded_at: Wed, 17 Aug 2016 03:25:50 GMT 77 | recorded_with: VCR 3.0.3 78 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Condition/should_contain_a_weather_condition_code_a_date_a_temperature_and_a_description.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=9848%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aae372a3-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:48 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Via: 40 | - http/1.1 a01.ue.gq1.yahoo.net (ApacheTrafficServer [cMsSf ]) 41 | Y-Trace: 42 | - BAEAQAAAAADNuNZ35V5yiAAAAAAAAAAAMDLMEhai3BgAAAAAAAAAAAAFOjwFgofsAAU6PAWCr97Pd8SJAAAAAA-- 43 | Transfer-Encoding: 44 | - chunked 45 | Connection: 46 | - keep-alive 47 | body: 48 | encoding: UTF-8 49 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:48Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 50 | Weather - Victoria, BC, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","description":"Yahoo! 51 | Weather for Victoria, BC, CA","language":"en-us","lastBuildDate":"Tue, 16 52 | Aug 2016 08:25 PM PDT","ttl":"60","location":{"city":"Victoria","country":"Canada","region":" 53 | BC"},"wind":{"chill":"64","direction":"235","speed":"28.97"},"atmosphere":{"humidity":"72","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:10 54 | am","sunset":"8:24 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 55 | for Victoria, BC, CA at 07:00 PM PDT","lat":"48.42828","long":"-123.3564","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-9848/","pubDate":"Tue, 56 | 16 Aug 2016 07:00 PM PDT","condition":{"code":"32","date":"Tue, 16 Aug 2016 57 | 07:00 PM PDT","temp":"18","text":"Sunny"},"forecast":[{"code":"32","date":"16 58 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Sunny"},{"code":"32","date":"17 59 | Aug 2016","day":"Wed","high":"18","low":"15","text":"Sunny"},{"code":"32","date":"18 60 | Aug 2016","day":"Thu","high":"26","low":"16","text":"Sunny"},{"code":"32","date":"19 61 | Aug 2016","day":"Fri","high":"23","low":"19","text":"Sunny"},{"code":"32","date":"20 62 | Aug 2016","day":"Sat","high":"22","low":"17","text":"Sunny"},{"code":"32","date":"21 63 | Aug 2016","day":"Sun","high":"19","low":"16","text":"Sunny"},{"code":"34","date":"22 64 | Aug 2016","day":"Mon","high":"17","low":"15","text":"Mostly Sunny"},{"code":"30","date":"23 65 | Aug 2016","day":"Tue","high":"18","low":"16","text":"Partly Cloudy"},{"code":"34","date":"24 66 | Aug 2016","day":"Wed","high":"21","low":"16","text":"Mostly Sunny"},{"code":"34","date":"25 67 | Aug 2016","day":"Thu","high":"23","low":"18","text":"Mostly Sunny"}],"description":"\n
\nCurrent Conditions:\n
Sunny\n
\n
\nForecast:\n
Tue - Sunny. High: 18Low: 70 | 16\n
Wed - Sunny. High: 18Low: 15\n
Thu - Sunny. High: 26Low: 71 | 16\n
Fri - Sunny. High: 23Low: 19\n
Sat - Sunny. High: 22Low: 72 | 17\n
\n
\nFull 73 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 75 | http_version: 76 | recorded_at: Wed, 17 Aug 2016 03:25:48 GMT 77 | recorded_with: VCR 3.0.3 78 | -------------------------------------------------------------------------------- /spec/fixtures/cassettes/Weather_Location/should_be_able_to_look_up_Nice_France.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid=614274%20and%20u=%27c%27 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept-Encoding: 11 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 12 | Accept: 13 | - "*/*" 14 | User-Agent: 15 | - Ruby 16 | Host: 17 | - query.yahooapis.com 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | X-Yql-Host: 24 | - prod_gq1_1;paas.yql;queryyahooapiscomproductiongq1;aae56e8c-5f25-11e6-acf5-f0921c12e67c 25 | X-Content-Type-Options: 26 | - nosniff 27 | Access-Control-Allow-Origin: 28 | - "*" 29 | Content-Type: 30 | - application/json; charset=UTF-8 31 | Cache-Control: 32 | - no-cache 33 | Date: 34 | - Wed, 17 Aug 2016 03:25:49 GMT 35 | Age: 36 | - '0' 37 | Server: 38 | - ATS 39 | Via: 40 | - http/1.1 a12.ue.gq1.yahoo.net (ApacheTrafficServer [cMsSf ]) 41 | Y-Trace: 42 | - BAEAQAAAAAD6HWgWLfRWkgAAAAAAAAAAIC5919ESryQAAAAAAAAAAAAFOjwFkNYRAAU6PAWQ96_yU244AAAAAA-- 43 | Transfer-Encoding: 44 | - chunked 45 | Connection: 46 | - keep-alive 47 | body: 48 | encoding: UTF-8 49 | string: '{"query":{"count":1,"created":"2016-08-17T03:25:49Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! 50 | Weather - Nice, Provence-Alpes-Cote d''Azur, FR","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-614274/","description":"Yahoo! 51 | Weather for Nice, Provence-Alpes-Cote d''Azur, FR","language":"en-us","lastBuildDate":"Wed, 52 | 17 Aug 2016 05:25 AM CEST","ttl":"60","location":{"city":"Nice","country":"France","region":" 53 | Provence-Alpes-Cote d''Azur"},"wind":{"chill":"70","direction":"35","speed":"17.70"},"atmosphere":{"humidity":"75","pressure":"33626.85","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"6:39 54 | am","sunset":"8:29 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 55 | for Nice, Provence-Alpes-Cote d''Azur, FR at 04:00 AM CEST","lat":"43.704441","long":"7.25217","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-614274/","pubDate":"Wed, 56 | 17 Aug 2016 04:00 AM CEST","condition":{"code":"31","date":"Wed, 17 Aug 2016 57 | 04:00 AM CEST","temp":"20","text":"Clear"},"forecast":[{"code":"4","date":"17 58 | Aug 2016","day":"Wed","high":"26","low":"20","text":"Thunderstorms"},{"code":"47","date":"18 59 | Aug 2016","day":"Thu","high":"26","low":"20","text":"Scattered Thunderstorms"},{"code":"30","date":"19 60 | Aug 2016","day":"Fri","high":"26","low":"20","text":"Partly Cloudy"},{"code":"30","date":"20 61 | Aug 2016","day":"Sat","high":"27","low":"22","text":"Partly Cloudy"},{"code":"34","date":"21 62 | Aug 2016","day":"Sun","high":"27","low":"20","text":"Mostly Sunny"},{"code":"32","date":"22 63 | Aug 2016","day":"Mon","high":"27","low":"20","text":"Sunny"},{"code":"32","date":"23 64 | Aug 2016","day":"Tue","high":"28","low":"21","text":"Sunny"},{"code":"32","date":"24 65 | Aug 2016","day":"Wed","high":"28","low":"20","text":"Sunny"},{"code":"32","date":"25 66 | Aug 2016","day":"Thu","high":"29","low":"20","text":"Sunny"},{"code":"32","date":"26 67 | Aug 2016","day":"Fri","high":"29","low":"21","text":"Sunny"}],"description":"\n
\nCurrent Conditions:\n
Clear\n
\n
\nForecast:\n
Wed - Thunderstorms. High: 70 | 26Low: 20\n
Thu - Scattered Thunderstorms. High: 26Low: 20\n
Fri 71 | - Partly Cloudy. High: 26Low: 20\n
Sat - Partly Cloudy. High: 27Low: 72 | 22\n
Sun - Mostly Sunny. High: 27Low: 20\n
\n
\nFull 73 | Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>","guid":{"isPermaLink":"false"}}}}}}' 75 | http_version: 76 | recorded_at: Wed, 17 Aug 2016 03:25:49 GMT 77 | recorded_with: VCR 3.0.3 78 | --------------------------------------------------------------------------------