Return to Snippet

Revision: 38505
at January 4, 2011 09:26 by chrisaiv


Initial Code
require 'cgi'
require 'rss'
require 'open-uri'
require 'rexml/document'

xspf = "http://915.kuscstream.org:8000/kuscaudio128.mp3.xspf"

open( xspf ) do |http|
  response = http.read
    
  xml = REXML::Document.new( response )
  xml.elements.each do |t|
    puts t
  end

=begin
result = RSS::Parser.parse(response, false)
  puts result

  items = result.playlist
  puts items
  items.each do |item|
  #  puts "Title:" + item.title + "\n" + item.link + " \n" + item.description + "\n"
  end
=end
end

Initial URL


Initial Description
IceCast server's sometimes offer meta-data information on a particular piece.  Here's an example of a data scrape from Classical KUSC

Initial Title
Ruby: Capturing Song Title information from an IceCast Server

Initial Tags
ruby, xml

Initial Language
Ruby