Skip to content

Instantly share code, notes, and snippets.

@ttscoff
Created July 28, 2014 18:40
Show Gist options
  • Save ttscoff/d139fa34967c36545d16 to your computer and use it in GitHub Desktop.
Save ttscoff/d139fa34967c36545d16 to your computer and use it in GitHub Desktop.
Quick Dark Sky forecast script for my GeekTool setup. Needs forecast_io gem and an API key, edit the coordinates as needed
#!/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment