Skip to content

Instantly share code, notes, and snippets.

@m-crawley
Forked from ttscoff/forecast.rb
Created January 28, 2016 14:58
Show Gist options
  • Select an option

  • Save m-crawley/e1f8e08751d14e432353 to your computer and use it in GitHub Desktop.

Select an option

Save m-crawley/e1f8e08751d14e432353 to your computer and use it in GitHub Desktop.

Revisions

  1. @ttscoff ttscoff created this gist Jul 28, 2014.
    13 changes: 13 additions & 0 deletions forecast.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    #!/usr/bin/ruby
    require 'rubygems'
    require 'forecast_io'

    ForecastIO.api_key = 'xxxxxxxxxxxx'

    forecast = ForecastIO.forecast(44.047889,-91.640439)

    if ARGV[0] == "current"
    print "#{forecast.currently.temperature.round}, #{forecast.currently.summary}"
    else
    print forecast.minutely.summary
    end