![]() |
![]() |
#1 (permalink) |
Psycho
|
[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; } Code:
Can't find string terminator "EOF" anywhere before EOF at ./mplay.pl line 35. 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 |
![]() |
![]() |
#2 (permalink) |
I am Winter Born
Location: Alexandria, VA
|
The problem is that the "EOF" statement shouldn't be indented. Perl expects it to be at the absolute start of the line - otherwise it treats the line as text to be printed. Remove the space in front of it and it should work.
|
![]() |
![]() |
#3 (permalink) | |
Junkie
|
Quote:
|
|
![]() |
Tags |
linux, mplayer, perl, script, webradio |
|
|