Skip to content

Commit

Permalink
Added weather bin that does a quick show of the weather from the comm…
Browse files Browse the repository at this point in the history
…and line.
  • Loading branch information
jnunemaker committed Mar 27, 2009
1 parent 1affe3d commit 5a3352c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions bin/weather
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby

require File.dirname(__FILE__) + '/../lib/google_weather'

if ARGV.size == 0
puts 'Weather [Powered by Google]'
puts 'USAGE: weather [zip code or city]'
puts 'EXAMPLES:'
puts ' weather 46544'
puts ' weather "mishawaka, in"'
exit
end

weather = GoogleWeather.new(ARGV[0])
current = weather.current_conditions
puts "#{current.temp_f}° #{current.condition} - #{current.wind_condition} - #{current.humidity}"
2 changes: 2 additions & 0 deletions examples/forecast.rb
Expand Up @@ -7,5 +7,7 @@
puts forecast.day_of_week, forecast.low, forecast.high, forecast.condition puts forecast.day_of_week, forecast.low, forecast.high, forecast.condition


pp weather.forecast_information pp weather.forecast_information
puts
pp weather.current_conditions pp weather.current_conditions
puts
pp weather.forecast_conditions pp weather.forecast_conditions

0 comments on commit 5a3352c

Please sign in to comment.