View Single Post
Old 07-13-2005, 05:46 PM   #1 (permalink)
keyshawn
Psycho
 
keyshawn's Avatar
 
[Perl] [Linux] Mplayer Webradio script

Hey,

I found this script


online to simply play your favorite web radio stations
Code:
#!/usr/bin/perl -w
 
 #NOTE: "mplay woxy" plays the woxy stream quickly and
#without a browser. If you need your terminal, "q" stops the stream, do
#your deed, and up arrow gets the stream right back (or of course Ctrl+
#Shift+T for a new tab in gnome-terminal).
 
 	# mplay.pl -
 	# command line streaming of your fav stations
 	# usage: mplay <channel>
 
 	use strict;
 
 	help() unless defined(my $chan = shift);
 
 	if ($chan =~ /woxy/) {
 		system("mplayer http://woxy.com/stream/mpg64.pls");
 	}
 	elsif ($chan =~ /wjcu/) {
         	system("mplayer http://streaming.jcu.edu:8000/listen.pls");
 	}
 	elsif ($chan =~ /case/) {
 		system("mplayer http://129.22.71.14/cgi-bin/swsend/tmp/wruw128k.mp3");
 	}
 	elsif ($chan =~ /emer/) {
 		system("mplayer http://www.wers.org/wers.pls");
 	}
 	elsif ($chan =~ /talk/) {
 		system("mplayer http://broadcast.rantradio.com:9010");
 	}
 	else { help(); }
 
 	sub help {
 
 	print <<EOF;
 
 	Usage: mplay <channel>
 
 	Channels:
 	woxy - Woxy.com - 
 	wjcu - John Carroll - 88.7 - 397.4438
 	case - WRUW - 91.1 - 368-2208
 	emer - Emerson College - WERS
 	talk - RantRadio Talk
 
 	EOF
 
 	exit;
 	}
When I try to run this script in its current directory [I named the script mplay.pl] I received this output error:

Code:
 Can't find string terminator "EOF" anywhere before EOF at ./mplay.pl line 35.
I don't program really [unless you want to include messing with BASIC 3 years ago] so I can't really help you out, I hope I've given enough information to help.

Catcha back on the flipside,
keyshawn
__________________
currently reading:

currently playing :

Last edited by keyshawn; 07-13-2005 at 05:48 PM.. Reason: clarified the title
keyshawn is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73