README.rdoc in barometer-0.1.0 vs README.rdoc in barometer-0.2.1

- old
+ new

@@ -6,32 +6,47 @@ of your choice. Weather services can co-exist to retrieve extensive information, or they can be used in a hierarchical configuration where lower preferred weather services are only used if previous services are unavailable. +== version + +Version 0.1.0 is the current release of this gem. +The gem is available from github (attack-barometer) or rubyforge (barometer). +It is fully functional (for three weather service APIs). + == status Currently this project is in development and will only work for a few weather services (wunderground, google, yahoo). -Features to be added before first release: -- gem setup/config, apply to rubyforge - -Features to be added in future releases: +Features to be added next: - even more weather service drivers (noaa, weather.com, weatherbug) -- ability to query multiple services and combine/average the results -- support iaco as a query format = dependencies +=== Google API key + +In most cases you will need to have a free google geocode api key. +Get one here: http://code.google.com/apis/maps/signup.html +Then put it in the file '~/.barometer' by adding the line: +geocode_google: YOUR_KEY_HERE + +You will need this for: +- using the Barometer gem (unless you use queries that are directly supported + by the weather source API, ie yahoo will take a zip code directly and doesn't + require any geocoding) +- running the Barometer binary +- running the Barometer Web Demo + === HTTParty Why? HTTParty was created and designed specifically for consuming web services. I choose to use this over using the Net::HTTP library directly to allow for faster development of this project. -HTTParty is also extended to include configurable Timoout support. +HTTParty is also extended to include configurable Timeout support. === tzinfo Why? Barometer deals with time information for locations all over the world. This information doesn't mean that much if it can't be converted to times @@ -94,11 +109,23 @@ You can use barometer from the command line. # barometer berlin This will output the weather information for the given query. +See the help for more command line information. + + # barometer -h + +=== web demo + +There is a Sinatra application that demos the functionality of Barometer, +and provides Barometer information. Start this local demo with: + + # barometer -w +NOTE: This requires the gems "sinatra" and "vegas". + === fail What would cause a weather service to fail? The most obvious is that the particular weather service in currently unavailable or not reachable. Other possible reasons would include not having the API (or a valid API @@ -185,9 +212,28 @@ time = Time.parse("13:00 01-01-2009") weather.for(time) # returns forecast_measurement for default at time weather.source(:wunderground).for(time) # same as above but specific source puts weather.source(:wunderground).for(time).low.f + +== averages + +If you consume more then one weather service, Barometer can provide averages +for the values (currently only for the 'current' values and not the forecasted +values). + + require 'barometer' + + Barometer.google_geocode_key = "THE_GOOGLE_API_KEY" + # use yahoo and wunderground + Barometer.selection = { 1 => [:yahoo, :wunderground] } + + barometer = Barometer.new("90210") + weather = barometer.measure + + puts weather.temperture + +This will calculate the average temperature as given by :yahoo and :wunderground == simple answers After you have measured the data, Barometer provides several "simple answer" methods to help you get answers to some basic questions. All examples assume