Skip to content

Instantly share code, notes, and snippets.

@meise
Created September 2, 2013 17:53
Show Gist options
  • Save meise/6415504 to your computer and use it in GitHub Desktop.
Save meise/6415504 to your computer and use it in GitHub Desktop.
Create doku wiki table with all talks available in frab xml export to track post-processing status.
#!/usr/bin/env ruby
# encoding: utf-8
require 'open-uri'
require 'nokogiri'
xml_data = Nokogiri::XML(open("http://programm.froscon.org/2013/schedule.xml"))
conference = xml_data.xpath('//conference/title').text
days = xml_data.xpath('//*/day')
puts "~~NOTOC~~"
puts
puts "= #{conference}"
days.each do |day|
puts "== #{day[:date]}"
puts "^ ID ^ Slug ^ h264 ^ webm ^ opus ^ mp3 ^ Comment ^"
day.xpath('//*/event').each do |event|
puts "| #{event[:id]} | #{event.at_xpath('slug').text.gsub(':', '_')} | | | | | |"
end
end
gem install nokogiri
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment