barometer 0.7.3 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.travis.yml +7 -0
- data/LICENSE +1 -1
- data/{README.rdoc → README.md} +124 -110
- data/Rakefile +1 -21
- data/TODO +8 -9
- data/barometer.gemspec +20 -19
- data/bin/barometer +36 -83
- data/lib/barometer.rb +13 -11
- data/lib/barometer/base.rb +10 -10
- data/lib/barometer/data.rb +1 -1
- data/lib/barometer/data/distance.rb +25 -25
- data/lib/barometer/data/geo.rb +9 -9
- data/lib/barometer/data/local_datetime.rb +24 -20
- data/lib/barometer/data/local_time.rb +13 -13
- data/lib/barometer/data/location.rb +6 -6
- data/lib/barometer/data/pressure.rb +24 -24
- data/lib/barometer/data/speed.rb +28 -28
- data/lib/barometer/data/sun.rb +7 -7
- data/lib/barometer/data/temperature.rb +29 -29
- data/lib/barometer/data/units.rb +9 -9
- data/lib/barometer/data/zone.rb +19 -19
- data/lib/barometer/formats.rb +1 -1
- data/lib/barometer/formats/coordinates.rb +7 -7
- data/lib/barometer/formats/format.rb +6 -6
- data/lib/barometer/formats/geocode.rb +5 -5
- data/lib/barometer/formats/icao.rb +6 -6
- data/lib/barometer/formats/postalcode.rb +3 -3
- data/lib/barometer/formats/short_zipcode.rb +2 -2
- data/lib/barometer/formats/weather_id.rb +10 -10
- data/lib/barometer/formats/woe_id.rb +20 -20
- data/lib/barometer/formats/zipcode.rb +3 -3
- data/lib/barometer/key_file_parser.rb +20 -0
- data/lib/barometer/measurements/measurement.rb +32 -32
- data/lib/barometer/measurements/result.rb +39 -39
- data/lib/barometer/measurements/result_array.rb +12 -12
- data/lib/barometer/query.rb +15 -15
- data/lib/barometer/services.rb +3 -3
- data/lib/barometer/translations/icao_country_codes.yml +20 -20
- data/lib/barometer/translations/weather_country_codes.yml +1 -1
- data/lib/barometer/translations/zone_codes.yml +2 -2
- data/lib/barometer/version.rb +3 -0
- data/lib/barometer/weather.rb +27 -27
- data/lib/barometer/weather_services/noaa.rb +314 -3
- data/lib/barometer/weather_services/service.rb +32 -30
- data/lib/barometer/weather_services/weather_bug.rb +35 -33
- data/lib/barometer/weather_services/wunderground.rb +31 -29
- data/lib/barometer/weather_services/yahoo.rb +36 -35
- data/lib/barometer/web_services/geocode.rb +5 -7
- data/lib/barometer/web_services/noaa_station_id.rb +53 -0
- data/lib/barometer/web_services/placemaker.rb +11 -13
- data/lib/barometer/web_services/timezone.rb +5 -7
- data/lib/barometer/web_services/weather_id.rb +4 -6
- data/lib/barometer/web_services/web_service.rb +4 -4
- data/spec/barometer_spec.rb +25 -27
- data/spec/cassettes/Barometer.json +1 -0
- data/spec/cassettes/Query.json +1 -0
- data/spec/cassettes/Query_Format_Coordinates.json +1 -0
- data/spec/cassettes/Query_Format_Geocode.json +1 -0
- data/spec/cassettes/Query_Format_WeatherID.json +1 -0
- data/spec/cassettes/Query_Format_WoeID.json +1 -0
- data/spec/cassettes/WeatherService.json +1 -0
- data/spec/cassettes/WeatherService_Noaa.json +1 -0
- data/spec/cassettes/WeatherService_WeatherBug.json +1 -0
- data/spec/cassettes/WeatherService_Wunderground.json +1 -0
- data/spec/cassettes/WeatherService_Yahoo.json +1 -0
- data/spec/cassettes/WebService_Geocode.json +1 -0
- data/spec/cassettes/WebService_NoaaStation.json +1 -0
- data/spec/data/distance_spec.rb +60 -60
- data/spec/data/geo_spec.rb +23 -23
- data/spec/data/local_datetime_spec.rb +44 -44
- data/spec/data/local_time_spec.rb +47 -47
- data/spec/data/location_spec.rb +16 -16
- data/spec/data/pressure_spec.rb +61 -61
- data/spec/data/speed_spec.rb +69 -69
- data/spec/data/sun_spec.rb +25 -25
- data/spec/data/temperature_spec.rb +68 -68
- data/spec/data/units_spec.rb +21 -21
- data/spec/data/zone_spec.rb +35 -35
- data/spec/formats/coordinates_spec.rb +27 -27
- data/spec/formats/format_spec.rb +17 -25
- data/spec/formats/geocode_spec.rb +23 -31
- data/spec/formats/icao_spec.rb +26 -32
- data/spec/formats/postalcode_spec.rb +22 -28
- data/spec/formats/short_zipcode_spec.rb +20 -26
- data/spec/formats/weather_id_spec.rb +57 -67
- data/spec/formats/woe_id_spec.rb +59 -59
- data/spec/formats/zipcode_spec.rb +39 -47
- data/spec/key_file_parser_spec.rb +28 -0
- data/spec/measurements/measurement_spec.rb +79 -133
- data/spec/measurements/result_array_spec.rb +23 -38
- data/spec/measurements/result_spec.rb +100 -128
- data/spec/query_spec.rb +83 -100
- data/spec/spec_helper.rb +24 -6
- data/spec/weather_services/noaa_spec.rb +179 -0
- data/spec/weather_services/services_spec.rb +28 -36
- data/spec/weather_services/weather_bug_spec.rb +57 -77
- data/spec/weather_services/wunderground_spec.rb +36 -65
- data/spec/weather_services/yahoo_spec.rb +38 -60
- data/spec/weather_spec.rb +79 -79
- data/spec/web_services/geocode_spec.rb +7 -11
- data/spec/web_services/noaa_station_id_spec.rb +33 -0
- data/spec/web_services/placemaker_spec.rb +7 -12
- data/spec/web_services/web_services_spec.rb +3 -9
- metadata +214 -163
- data/VERSION.yml +0 -5
- data/lib/barometer/weather_services/google.rb +0 -142
- data/lib/barometer/weather_services/weather_dot_com.rb +0 -279
- data/spec/fakeweb_helper.rb +0 -179
- data/spec/fixtures/formats/weather_id/90210.xml +0 -7
- data/spec/fixtures/formats/weather_id/from_USGA0028.xml +0 -3
- data/spec/fixtures/formats/weather_id/ksfo.xml +0 -1
- data/spec/fixtures/formats/weather_id/manhattan.xml +0 -7
- data/spec/fixtures/formats/weather_id/new_york.xml +0 -1
- data/spec/fixtures/formats/weather_id/the_hills.xml +0 -1
- data/spec/fixtures/geocode/40_73_v3.json +0 -497
- data/spec/fixtures/geocode/90210_v3.json +0 -63
- data/spec/fixtures/geocode/T5B4M9_v3.json +0 -68
- data/spec/fixtures/geocode/atlanta_v3.json +0 -58
- data/spec/fixtures/geocode/calgary_ab_v3.json +0 -58
- data/spec/fixtures/geocode/ksfo_v3.json +0 -73
- data/spec/fixtures/geocode/newyork_ny_v3.json +0 -58
- data/spec/fixtures/services/google/calgary_ab.xml +0 -1
- data/spec/fixtures/services/placemaker/T5B4M9.xml +0 -65
- data/spec/fixtures/services/placemaker/atlanta.xml +0 -65
- data/spec/fixtures/services/placemaker/coords.xml +0 -65
- data/spec/fixtures/services/placemaker/ksfo.xml +0 -65
- data/spec/fixtures/services/placemaker/new_york.xml +0 -65
- data/spec/fixtures/services/placemaker/the_hills.xml +0 -65
- data/spec/fixtures/services/placemaker/w615702.xml +0 -47
- data/spec/fixtures/services/weather_bug/90210_current.xml +0 -93
- data/spec/fixtures/services/weather_bug/90210_forecast.xml +0 -76
- data/spec/fixtures/services/weather_dot_com/90210.xml +0 -1
- data/spec/fixtures/services/wunderground/current_calgary_ab.xml +0 -9
- data/spec/fixtures/services/wunderground/forecast_calgary_ab.xml +0 -13
- data/spec/fixtures/services/yahoo/90210.xml +0 -3
- data/spec/weather_services/google_spec.rb +0 -181
- data/spec/weather_services/weather_dot_com_spec.rb +0 -224
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/LICENSE
CHANGED
data/{README.rdoc → README.md}
RENAMED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# barometer
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/attack/barometer.png?branch=master)](https://travis-ci.org/attack/barometer)
|
2
4
|
|
3
5
|
A multi API consuming weather forecasting superstar.
|
4
6
|
|
@@ -13,54 +15,46 @@ same query can be used for all (or most) services, even if they don't
|
|
13
15
|
support the query directly. See the "Query" section for more information on
|
14
16
|
this.
|
15
17
|
|
16
|
-
|
18
|
+
## version
|
17
19
|
|
18
|
-
Version 0.7.
|
19
|
-
|
20
|
-
Older version are available through rubyforge (barometer) and github
|
21
|
-
(attack-barometer).
|
20
|
+
Version 0.7.4 is the current release of this gem. The gem is available from
|
21
|
+
rubygems (barometer: http://rubygems.org/gems/barometer).
|
22
22
|
It is fully functional (for five weather service APIs).
|
23
23
|
|
24
|
-
|
24
|
+
## status
|
25
25
|
|
26
26
|
Currently this project has completed initial development and will work for a
|
27
|
-
few weather services (wunderground,
|
28
|
-
Barometer is developed using only Ruby 1.9.
|
27
|
+
few weather services (wunderground, yahoo, weather_bug).
|
28
|
+
Barometer is developed using only Ruby 1.9.3, but will probably on both Ruby 1.8.7, 1.9.1 & 1.9.2.
|
29
29
|
|
30
30
|
Features to be added in the future:
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
* better command line output
|
32
|
+
* even more weather service drivers (hamweather)
|
33
|
+
* icon support
|
34
34
|
|
35
|
-
|
35
|
+
# dependencies
|
36
36
|
|
37
|
-
|
37
|
+
## Google API key
|
38
38
|
|
39
39
|
As stated on the Google Geocoding API website
|
40
40
|
(http://code.google.com/apis/maps/documentation/geocoding/), Google no longer
|
41
41
|
requires an API key. Therefore Barometer no longer requires a Google API key.
|
42
42
|
|
43
|
-
|
43
|
+
### other keys
|
44
44
|
|
45
45
|
The '~/.barometer' file can hold all your weather service API keys.
|
46
46
|
|
47
|
-
eg. weather.com
|
48
|
-
|
49
|
-
weather:
|
50
|
-
partner: YOUR_PARTNER_KEY
|
51
|
-
license: YOUR_LICENSE_KEY
|
52
|
-
|
53
47
|
eg. weatherbug.com
|
54
48
|
|
55
49
|
weather_bug:
|
56
50
|
code: YOUR_API_CODE
|
57
|
-
|
51
|
+
|
58
52
|
eg. Yahoo! Placemaker
|
59
53
|
|
60
54
|
yahoo:
|
61
55
|
app_id: YOUR_APP_ID
|
62
56
|
|
63
|
-
|
57
|
+
## HTTParty
|
64
58
|
|
65
59
|
Why? HTTParty was created and designed specifically for consuming web services.
|
66
60
|
I choose to use this over using the Net::HTTP library directly to allow for
|
@@ -68,14 +62,14 @@ faster development of this project.
|
|
68
62
|
|
69
63
|
It is possible that I will use Net::HTTP in the future.
|
70
64
|
|
71
|
-
|
65
|
+
## tzinfo
|
72
66
|
|
73
67
|
Why? Barometer deals with time information for locations all over the world.
|
74
68
|
This information doesn't mean that much if it can't be converted to times
|
75
69
|
that don't correspond to the applicable timezone.
|
76
70
|
Tzinfo handles this time zone manipulation.
|
77
71
|
|
78
|
-
|
72
|
+
# queries
|
79
73
|
|
80
74
|
The query handling is one of the most beneficial and powerful features of
|
81
75
|
Barometer. Every weather service accepts a different set of possible
|
@@ -91,20 +85,20 @@ For example, Yahoo! only accepts US Zip Code or Weather.com ID. With Barometer
|
|
91
85
|
you can query Yahoo! with a simple location (ie: Paris) or even an Airport
|
92
86
|
code (ICAO) and it will return the weather as expected.
|
93
87
|
|
94
|
-
|
88
|
+
## acceptable formats
|
95
89
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
90
|
+
* zipcode
|
91
|
+
* icao (international airport code)
|
92
|
+
* coordinates (latitude and longitude)
|
93
|
+
* postal code
|
94
|
+
* weather.com ID
|
95
|
+
* location name (ie address, city, state, landmark, etc.)
|
96
|
+
* woeid (where on earth id, by Yahoo!)
|
103
97
|
|
104
|
-
*
|
105
|
-
|
106
|
-
|
107
|
-
|
98
|
+
*if the query is of the formats zipcode or postal code it may not
|
99
|
+
support conversion to other formats.*
|
100
|
+
|
101
|
+
## conversion caching
|
108
102
|
|
109
103
|
Barometer has internal conversion caching. No conversion will be
|
110
104
|
repeated during a measurement, thus limiting the number of web queries
|
@@ -115,30 +109,30 @@ then use a query like "denver", this will require a conversion from
|
|
115
109
|
"denver" to its weather.com weather_id. This conversion is needed for
|
116
110
|
both web services but will only happen once and be cached.
|
117
111
|
|
118
|
-
|
112
|
+
# usage
|
119
113
|
|
120
114
|
You can use barometer right out of the box, as it is configured to use one
|
121
115
|
register-less (no API key required) international weather service
|
122
116
|
(wunderground.com).
|
123
117
|
|
118
|
+
```ruby
|
124
119
|
require 'barometer'
|
125
|
-
|
120
|
+
|
126
121
|
barometer = Barometer.new("Paris")
|
127
122
|
weather = barometer.measure
|
128
|
-
|
123
|
+
|
129
124
|
puts weather.current.temperature
|
130
|
-
|
131
|
-
|
125
|
+
```
|
126
|
+
|
127
|
+
## sources
|
132
128
|
|
133
129
|
The available sources are:
|
134
130
|
|
135
131
|
Wunderground.com (:wunderground) [default]
|
136
132
|
Yahoo! Weather (:yahoo)
|
137
|
-
Google Weather (:google)
|
138
|
-
Weather.com (:weather_dot_com) [requires key]
|
139
133
|
WeatherBug.com (:weather_bug) [requires key]
|
140
|
-
|
141
|
-
|
134
|
+
|
135
|
+
## source configuration
|
142
136
|
|
143
137
|
Barometer can be configured to use multiple weather service APIs (either in
|
144
138
|
a primary/failover config or in parallel). Each weather service can also
|
@@ -146,45 +140,55 @@ have its own config.
|
|
146
140
|
|
147
141
|
Weather services in parallel
|
148
142
|
|
149
|
-
|
150
|
-
|
143
|
+
```ruby
|
144
|
+
Barometer.config = { 1 => [:yahoo, :wunderground] }
|
145
|
+
```
|
146
|
+
|
151
147
|
Weather services in primary/failover
|
152
148
|
|
149
|
+
```ruby
|
153
150
|
Barometer.config = { 1 => [:yahoo], 2 => :wunderground }
|
154
|
-
|
151
|
+
```
|
152
|
+
|
155
153
|
Weather services, one with some configuration. In this case we are setting
|
156
154
|
a weight value, this weight is respected when calculating averages.
|
157
155
|
|
158
|
-
|
159
|
-
|
156
|
+
```ruby
|
157
|
+
Barometer.config = { 1 => [{:wunderground => {:weight => 2}}, :yahoo] }
|
158
|
+
```
|
159
|
+
|
160
160
|
Weather services, one with keys.
|
161
161
|
|
162
|
-
|
163
|
-
|
164
|
-
|
162
|
+
```ruby
|
163
|
+
Barometer.config = { 1 => [:yahoo, {:weather_bug => {:keys => {:code => CODE_KEY} }}] }
|
164
|
+
```
|
165
|
+
|
166
|
+
### multiple weather API, with hierarchy
|
165
167
|
|
168
|
+
```ruby
|
166
169
|
require 'barometer'
|
167
|
-
|
168
|
-
# use yahoo and
|
169
|
-
Barometer.config = { 1 => [:yahoo, :
|
170
|
+
|
171
|
+
# use yahoo and weather.com, if they both fail, use wunderground
|
172
|
+
Barometer.config = { 1 => [:yahoo, {:weather_bug => {:keys => {:code => CODE_KEY} }}], 2 => :wunderground }
|
170
173
|
|
171
174
|
barometer = Barometer.new("Paris")
|
172
175
|
weather = barometer.measure
|
173
176
|
|
174
177
|
puts weather.current.temperture
|
175
|
-
|
176
|
-
|
178
|
+
```
|
179
|
+
|
180
|
+
## command line
|
177
181
|
|
178
182
|
You can use barometer from the command line.
|
179
|
-
|
183
|
+
|
180
184
|
# barometer berlin
|
181
|
-
|
185
|
+
|
182
186
|
This will output the weather information for the given query.
|
183
187
|
See the help for more command line information.
|
184
188
|
|
185
189
|
# barometer -h
|
186
|
-
|
187
|
-
|
190
|
+
|
191
|
+
### fail
|
188
192
|
|
189
193
|
What would cause a weather service to fail? The most obvious is that the
|
190
194
|
particular weather service in currently unavailable or not reachable.
|
@@ -196,62 +200,71 @@ weather service.
|
|
196
200
|
For example, if you look at the example above, the query of "Paris" refers
|
197
201
|
to a city in France. Yahoo weather services only supports
|
198
202
|
weather results for USA (at least at the time of writing). Therefore,
|
199
|
-
Barometer would not use Yahoo, just
|
203
|
+
Barometer would not use Yahoo, just WeatherBug and failover to use Wunderground
|
200
204
|
(if needed).
|
201
205
|
|
202
|
-
|
206
|
+
## searching
|
203
207
|
|
204
208
|
After you have measured the data, Barometer provides several methods to help
|
205
209
|
you get the data you are after. All examples assume you already have measured
|
206
210
|
the data as shown in the above examples.
|
207
211
|
|
208
|
-
|
212
|
+
### by preference (default service)
|
209
213
|
|
214
|
+
```ruby
|
210
215
|
weather.default # returns measurement for default source
|
211
216
|
weather.current # returns current_measurement for default
|
212
217
|
weather.now # returns current_measurement for default
|
213
218
|
weather.forecast # returns all forecast_measurements for default
|
214
219
|
weather.today # returns forecast_measurement for default today
|
215
220
|
weather.tomorrow # returns forecast_measurement for default tomorrow
|
216
|
-
|
221
|
+
|
217
222
|
puts weather.now.temperature.c
|
218
223
|
puts weather.tomorrow.high.c
|
224
|
+
```
|
219
225
|
|
220
|
-
|
226
|
+
### by source
|
221
227
|
|
228
|
+
```ruby
|
222
229
|
weather.source(:wunderground) # returns measurement for specified source
|
223
230
|
weather.sources # lists all successful sources
|
224
|
-
|
231
|
+
|
225
232
|
puts weather.source(:wunderground).current.temperature.c
|
233
|
+
```
|
226
234
|
|
227
|
-
|
235
|
+
### by date
|
228
236
|
|
237
|
+
```ruby
|
229
238
|
# note, the date is the date of the locations weather, not the date of the
|
230
239
|
# user measuring the weather
|
231
240
|
date = Date.parse("01-01-2009")
|
232
241
|
weather.for(date) # returns forecast_measurement for default on date
|
233
242
|
weather.source(:wunderground).for(date) # same as above but specific source
|
234
|
-
|
243
|
+
|
235
244
|
puts weather.source(:wunderground).for(date).high.c
|
245
|
+
```
|
236
246
|
|
237
|
-
|
247
|
+
### by time
|
238
248
|
|
249
|
+
```ruby
|
239
250
|
# note, the time is the time of the locations weather, not the time of the
|
240
251
|
# user measuring the weather
|
241
252
|
time = Time.parse("13:00 01-01-2009")
|
242
253
|
weather.for(time) # returns forecast_measurement for default at time
|
243
254
|
weather.source(:wunderground).for(time) # same as above but specific source
|
244
|
-
|
255
|
+
|
245
256
|
puts weather.source(:wunderground).for(time).low.f
|
246
|
-
|
247
|
-
|
257
|
+
```
|
258
|
+
|
259
|
+
## averages
|
248
260
|
|
249
261
|
If you consume more then one weather service, Barometer can provide averages
|
250
262
|
for the values (currently only for the 'current' values and not the forecasted
|
251
263
|
values).
|
252
264
|
|
265
|
+
```ruby
|
253
266
|
require 'barometer'
|
254
|
-
|
267
|
+
|
255
268
|
Barometer.google_geocode_key = "THE_GOOGLE_API_KEY"
|
256
269
|
# use yahoo and wunderground
|
257
270
|
Barometer.config = { 1 => [:yahoo, :wunderground] }
|
@@ -260,16 +273,17 @@ values).
|
|
260
273
|
weather = barometer.measure
|
261
274
|
|
262
275
|
puts weather.temperture
|
276
|
+
```
|
263
277
|
|
264
278
|
This will calculate the average temperature as given by :yahoo and :wunderground
|
265
279
|
|
266
|
-
|
280
|
+
### weights
|
267
281
|
|
268
282
|
You can weight the values from a weather service so that the values from that
|
269
283
|
web service have more influence then other values. The weights are set in the
|
270
284
|
config ... see the config section
|
271
285
|
|
272
|
-
|
286
|
+
## simple answers
|
273
287
|
|
274
288
|
After you have measured the data, Barometer provides several "simple answer"
|
275
289
|
methods to help you get answers to some basic questions. All examples assume
|
@@ -280,7 +294,7 @@ are configured to use. All sources that have successfully measured data
|
|
280
294
|
will be asked, but if there is no data that can answer the question then
|
281
295
|
there will be no answer.
|
282
296
|
|
283
|
-
|
297
|
+
### is it windy?
|
284
298
|
|
285
299
|
# 1st parameter is the threshold wind speed for being windy
|
286
300
|
# 2nd parameter is the utc_time for which you want to know the answer,
|
@@ -288,8 +302,8 @@ there will be no answer.
|
|
288
302
|
# NOTE: in my example the values are metric, so the threshold is 10 kph
|
289
303
|
|
290
304
|
weather.windy?(10)
|
291
|
-
|
292
|
-
|
305
|
+
|
306
|
+
### is it wet?
|
293
307
|
|
294
308
|
# 1st parameter is the threshold pop (%) for being wet
|
295
309
|
# 2nd parameter is the utc_time for which you want to know the answer,
|
@@ -298,69 +312,69 @@ there will be no answer.
|
|
298
312
|
|
299
313
|
weather.wet?(50)
|
300
314
|
|
301
|
-
|
315
|
+
### is it sunny?
|
302
316
|
|
303
317
|
# 1st parameter is the utc_time for which you want to know the answer,
|
304
318
|
# this defaults to the current time
|
305
319
|
|
306
320
|
weather.sunny?
|
307
321
|
|
308
|
-
|
322
|
+
### is it day?
|
309
323
|
|
310
324
|
# 1st parameter is the utc_time for which you want to know the answer,
|
311
325
|
# this defaults to the current time
|
312
326
|
|
313
327
|
weather.day?
|
314
328
|
|
315
|
-
|
329
|
+
### is it night?
|
316
330
|
|
317
331
|
# 1st parameter is the utc_time for which you want to know the answer,
|
318
332
|
# this defaults to the current time
|
319
333
|
|
320
334
|
weather.night?
|
321
335
|
|
322
|
-
|
336
|
+
# design
|
323
337
|
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
338
|
+
* create a Barometer instance
|
339
|
+
* supply a query, there are very little restrictions on the format:
|
340
|
+
* city, country, specific address (basically anything Google will geocode)
|
341
|
+
* US zip code (skips conversion if weather service accepts this directly)
|
342
|
+
* postal code (skips conversion if weather service accepts this directly)
|
343
|
+
* latitude and longitude (skips conversion if weather service accepts this
|
330
344
|
directly)
|
331
|
-
|
332
|
-
|
345
|
+
* weather.com weather id (even if the service you are using doesn't use it)
|
346
|
+
* international airport code (skips conversion if weather service
|
333
347
|
accepts this directly)
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
348
|
+
* determine which weather services will be queried (one or multiple)
|
349
|
+
* if query conversion required for specific weather service, convert the query
|
350
|
+
* query the weather services
|
351
|
+
* save the data
|
352
|
+
* repeat weather service queries as needed
|
339
353
|
|
340
|
-
|
354
|
+
# extending
|
341
355
|
|
342
356
|
Barometer attempts to be a common API to any weather service API. I have included
|
343
357
|
several weather service 'drivers', but I know there are many more available.
|
344
358
|
Please use the provided ones as examples to create more.
|
345
359
|
|
346
|
-
|
360
|
+
# development
|
347
361
|
|
348
362
|
Barometer now uses 'bundler'. You just need to 'git clone' the repo and 'bundle install'.
|
349
363
|
|
350
|
-
|
364
|
+
## Contributions
|
351
365
|
|
352
366
|
Thank you to these developers who have contributed. No contribution is too small.
|
353
367
|
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
368
|
+
* nofxx (https://github.com/nofxx)
|
369
|
+
* floere (https://github.com/floere)
|
370
|
+
* plukevdh (https://github.com/plukevdh)
|
371
|
+
* gkop (https://github.com/gkop)
|
358
372
|
|
359
|
-
|
373
|
+
# Links
|
360
374
|
|
361
|
-
|
362
|
-
|
375
|
+
* repo: http://github.com/attack/barometer
|
376
|
+
* rdoc: http://rdoc.info/projects/attack/barometer
|
363
377
|
|
364
|
-
|
378
|
+
## copyright
|
365
379
|
|
366
|
-
Copyright (c) 2009-
|
380
|
+
Copyright (c) 2009-2013 Mark G. See LICENSE for details.
|