Skip to content

Instantly share code, notes, and snippets.

@harrisonmalone
Last active September 24, 2018 10:03
Show Gist options
  • Save harrisonmalone/abc1534cf928ff450a0a896063ba25a9 to your computer and use it in GitHub Desktop.
Save harrisonmalone/abc1534cf928ff450a0a896063ba25a9 to your computer and use it in GitHub Desktop.
require 'forecast_io'
ForecastIO.api_key = ENV.fetch('DARK_SKY_API_KEY')
puts ENV['DARK_SKY_API_KEY']
lat = -37.815712
long = 144.955546
forecast = ForecastIO.forecast(lat, long)
puts forecast[:hourly][:data][0][:summary]
# puts "long = #{forecast.longitude}"
# puts "lat = #{forecast.latitude}"
# stuff that was put into bash, remember that you need to be in the same bash terminal to do stuff
# export DARK_SKY_API_KEY="what dark sky give you"
# echo $DARK_SKY_API_KEY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment