Skip to content

Instantly share code, notes, and snippets.

@iorionda
Created Jul 21, 2016
Embed
What would you like to do?
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.keys.each do |artist|
puts "*#{artist}"
items = artists[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