Skip to content

Instantly share code, notes, and snippets.

@hkraji
hkraji / weather.rb
Last active April 14, 2016 16:22
Improvement for gist https://gist.github.com/davefp/4990174 switching to Open Weather API
require 'net/http'
# you can find CITY_ID here http://bulk.openweathermap.org/sample/city.list.json.gz
CITY_ID = 2172517
# options: metric / imperial
UNITS = 'metric'
# create free account on open weather map to get API key
API_KEY = ENV['WEATHER_KEY']