Created
July 21, 2016 02:02
-
-
Save cheebow/0a5262420cd8450a70507f8f33e62729 to your computer and use it in GitHub Desktop.
TIF2016出演アイドル別に出演時間を表示する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open-uri' | |
require 'json' | |
response = open('http://www.idolfes.com/2016/json/timetable/time.json') | |
data = response.read | |
json = JSON.parse(data) | |
artists = {} | |
json.keys.each{|day| | |
json[day].keys.each{|stage| | |
json[day][stage].each{|item| | |
item["day"] = day | |
item["stage"] = stage | |
if !artists[item["artist"]] | |
artists[item["artist"]] = [] | |
end | |
artists[item["artist"]].push(item) | |
} | |
} | |
} | |
artists.keys.each{|artist| | |
puts "*" + artist | |
items = artists[artist] | |
items.each{|item| | |
puts "\t" + item["day"] + "[" + item["stage"] + "]" "(" + item["start"] + "-" + item["end"] + ")" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://gist.github.com/iorionda/39993c3998c79945ed61fdccd83250dc
こんな感じですかねえ。