#!/usr/local/bin/ruby require 'net/http' require 'uri' require 'json' url = "http://weather.livedoor.com/forecast/webservice/json/v1?city=011000" uri = URI.parse(url) json = Net::HTTP.get(uri) result = JSON.parse(json) #json_str = JSON.pretty_generate(result) #puts json_str#["pinpointLocations"]["name"] puts result.dig("pinpointLocations")#, "name")