From: hengist podd Date: 2007-07-21T17:32:37+09:00 Subject: Re: parsing iTunes Libary Dominik wrote: > I thought about writing something like that: > http://code.google.com/p/itunes-to-rhythmbox-ratings/ > > I wanted to parse the library with REXML but the file is quite big. You could look into using libxml: http://libxml.rubyforge.org/ http://raa.ruby-lang.org/search.rhtml?search=libxml Another option would be to access iTunes via its COM (Windows) or Apple event (OS X) API. e.g. Using rb-appscript on OS X: #!/usr/bin/env ruby require 'appscript' include Appscript t = app('iTunes').library_playlists[1].tracks t.name.get.zip(t.artist.get, t.rating.get).each do |name, artist, rating| p name, artist, rating end There's also a project to provide a common cross-platform API, although I don't know how far on it is yet: http://rubyforge.org/projects/rb-itunes/ HTH has -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org -- Posted via http://www.ruby-forum.com/.