mirror of
https://github.com/mii443/rbot.git
synced 2025-08-22 23:55:28 +00:00
Changed to use "to_json"
This commit is contained in:
@ -15,7 +15,7 @@ module Bot
|
|||||||
uri = URI.parse(JPN_WEATHER_FORECAST + "#{id}.js")
|
uri = URI.parse(JPN_WEATHER_FORECAST + "#{id}.js")
|
||||||
jsonp = Net::HTTP.get(uri)
|
jsonp = Net::HTTP.get(uri)
|
||||||
# JSONP -> JSONに変換
|
# JSONP -> JSONに変換
|
||||||
json = JSON.load(jsonp.match(/\.callback\((.*)\)/)[1])
|
json = JSON.load(jsonp.to_json)
|
||||||
|
|
||||||
weather = nil
|
weather = nil
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user