Skip to content

Instantly share code, notes, and snippets.

@qpfiffer
Created October 6, 2017 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qpfiffer/4e36eab675d10d2c9c4c44cbc507fd4c to your computer and use it in GitHub Desktop.
Save qpfiffer/4e36eab675d10d2c9c4c44cbc507fd4c to your computer and use it in GitHub Desktop.
require "json"
string = %({"coord":{"lon":-79.66,"lat":43.58},"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"base":"stations","main":{"temp":292.49,"pressure":1017,"humidity":63,"temp_min":291.15,"temp_max":294.15},"visibility":24140,"wind":{"speed":3.6,"deg":150},"clouds":{"all":90},"dt":1507320000,"sys":{"type":1,"id":3722,"message":0.004,"country":"CA","sunrise":1507288997,"sunset":1507330127},"id":6075357,"name":"Mississauga","cod":200})
value = JSON.parse(string)
puts value["main"]["temp"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment