#!/sw/bin/perl -w # "plugin" for netscape to play audio/x-scpls files (shoutcast streams) # uses xmms # updated for realplayer mp3 streaming # updated to select a random URL from the possible urls # # install as application for mimetype 'audio/x-scpls' and program # 'playpls %s' # # other mimetypes that would work (mp3.com): # audio/x-mpegurl # Koos van den Hout, koos@kzdoos.xs4all.nl, 20000721 use strict; use vars qw(@url $urlcnt $urlchoice); $urlcnt=0; open(FIN,$ARGV[0]); while (){ if (/^File\d+=(.*)\n$/){ $url[$urlcnt++]=$1; } } close(FIN); srand; $urlchoice=int(rand $urlcnt); # for realplayer (Solaris choice) system ("realplay $url[$urlchoice] &"); # for xmms (Linux choice) # system ("xmms $url[$urlchoice] &");