[Ruby]Blackberry playlist maker

Download | Vote Up (0) | Vote Down (0)
#!/usr/bin/ruby

#Use: playlister.rb in a dir with mp3 files todo a .m3u file for Blackberry
require "URI"

puts "\r\nChoose a name for the playlist : "
playlist = gets.chomp

plf = File.open(playlist+".m3u", "a")
Dir.glob("*").each do |file|
        if file != "playlister.rb" and file != playlist+".m3u"
                puts "\r\nWriting playlist..."
                plf.syswrite("file:///SDCard/BlackBerry/music/"+URI.escape(file)+"\r\n")
                puts file+"\r\n"        
        end
end

plf.close
puts "\r\nPlaylist created !"
gets

Zhyar


Be the first to give feedback !

Please login to comment !