# XSPF for Ruby

**URL:** <https://www.ruby-forum.com/t/xspf-for-ruby/72573>\
**Category:** Ruby\
**Created:** [October 18, 2006, 3:09am UTC](https://www.ruby-forum.com/t/xspf-for-ruby/72573 "2006-10-18T03:09:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pau\_Garcia\_i\_Quiles](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b9e5f3/32.png) [@Pau\_Garcia\_i\_Quiles](https://www.ruby-forum.com/u/Pau_Garcia_i_Quiles)\
**Post date:** [October 18, 2006, 3:09am UTC](https://www.ruby-forum.com/t/xspf-for-ruby/72573/1 "2006-10-18T03:09:10Z")

</div>

Hello,

URI

[http://www.elpauer.org/xspf/](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.
