Skip to content

Instantly share code, notes, and snippets.

@emad-elsaid
Created February 21, 2014 14:53
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save emad-elsaid/9135605 to your computer and use it in GitHub Desktop.
Save emad-elsaid/9135605 to your computer and use it in GitHub Desktop.
get wheather of any city using ruby
require 'open-uri'
require 'json'
require 'psych'
city = 'portsaid,egypt'
request = "http://api.openweathermap.org/data/2.5/weather?q=#{city}"
response = open(request).readlines.join
print Psych.dump( JSON.parse(response) )
@coderhs
Copy link

coderhs commented Mar 1, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment