XSPF for Ruby

Hello,

URI

http://www.elpauer.org/xspf/

SYNOPSIS

XSPF for Ruby is a pure-Ruby XML Shareable Playlist Format parser in
Ruby.

HISTORY

Current version is 0.2, the first public version.

STATUS

Parser mostly complete and working for 95% of uses.

Current limitations:
- Only read, not write, XSPF files
- For “link” and “extension” elements, only the first one is found
- The “attribution” element is not parsed (the XML content is
returned)
- The “extension” element is not parsed (the XML content is
returned)

EXAMPLE

require ‘xspf’

f = File.new(“playlist.xspf”)
x = XSPF.new(f)
pl = XSPF::Playlist.new(x)
tl = XSPF::Tracklist.new(pl)

puts “XML version: #{x.version}”
puts “XML encoding: #{ x.encoding}”
puts “XSPF version: #{pl.version}”
puts “Namespace: #{pl.xmlns}”
puts “Playlist title: #{pl.title}”
puts “Playlist creator: #{pl.creator}”
puts “Playlist annotation: #{pl.annotation}”
puts “Playlist info: #{pl.info}”
puts “Playlist identifier: #{pl.identifier}”
puts “Playlist attribution: #{pl.attribution}”
puts “Tracklist: #{pl.tracklist}”
tl.tracks.each do |t|
puts “Track identifier: #{t.identifier}”
puts “Track title: #{t.title}”
puts “Track creator: #{t.creator}”
puts “Track duration: #{t.duration}”
puts “Track metainformation: link=#{t.meta_rel}
content=#{t.meta_content}”
end

ROADMAP

0.3: Export XSPF to M3U, HTML, SMIL and SoundBox via XSLT
transformation
0.4: Generator: create XSPF documents

WHY

XSPF for Ruby is a side project born under the umbrella of spectaKle,
the
open source digital signage suite written in Ruby, QtRuby/Korundum and
Rails.