Skip to content

Instantly share code, notes, and snippets.

@masuidrive
Forked from cheebow/tif2016.rb
Last active July 21, 2016 06:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masuidrive/b768036439e4641e92f469e99023405a to your computer and use it in GitHub Desktop.
Save masuidrive/b768036439e4641e92f469e99023405a to your computer and use it in GitHub Desktop.
TIF2016出演アイドル別に出演時間を表示する
require 'open-uri'
require 'json'
response = open('http://www.idolfes.com/2016/json/timetable/time.json')
data = JSON.parse(response.read)
artists = {}
data.each do |day, stages|
stages.each do |stage, items|
items.each do |item|
(artists[item['artist']] ||= []) << item.merge(
'day' => day,
'stage' => stage
)
end
end
end
artists.each do |artist, items|
puts "*#{artist}"
items.each do |item|
puts "\t#{item['day']}[#{item['stage']}](#{item['start']}-#{item['end']})"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment