Scoop Box Exchange - Show Box: music 1.00
|
Description:
Will display information about the song currently playing on XMMS. Requires xmms info pipe
Box Code:
# code used from xmms InfoPipe by Weyfor WWWWolf
# additions/modifications by b1o
# requires xmms and xmms InfoPipe
use vars qw($tune $pos $status $time $total $current);
sub htmlescape {
my $string = shift;
$string =~ s/&/&/gi;
$string =~ s/</</gi;
$string =~ s/>/>/gi;
return $string;
}
open(INFO,"/tmp/xmms-info") or do {
print header();
exit(0);
};
while(<INFO>) {
chomp;
if(/^Status: (.*)$/)
{
$status = htmlescape($1);
}
if(/^Time: (.*)$/)
{
$time = htmlescape($1);
}
if(/^Tunes in playlist: (.*)$/)
{
$total = htmlescape($1);
}
if(/^Currently playing: (.*)$/)
{
$current = htmlescape($1);
}
if(/^Title: (.*)$/)
{
$tune = htmlescape($1);
}
if(/^Position: (.*)$/)
{
$pos = htmlescape($1);
}
}
close INFO;
my $content .= "$tune <br> status :: $status <br> total time :: $time <br> elapsed :: $pos <br> song :: $current of $total ";
return $content
|
|
The OpenNIC |
Democratically operated Domain Name System; using Scoop since Jan. 2001. |
|
|
|
|