#!/usr/bin/perl
use CGI;
$q=new CGI;
$file='FILL_IN_YOUR_FILES_FULL_PATH/wp_POST.txt';
$playing=$q->param('p');
$history=$q->param('history');
$song1=$q->param('Title1');
$song2=$q->param('Title2');
open (FILE,">$file");
print FILE "
My Playlist at this moment
\n";
if ($playing eq '1') {
print FILE "Currently Playing: $song1
\n";
if($history>1) {print FILE "Previously Played:- $song2\n";}
}
else {
print FILE "I am not listening to anything right now.
\n";
print FILE "Previously Played:- $song1\n";
if($history>1) {print FILE "
- $song2\n";}
}
for($i=3;$i<=$history;$i++)
{
$temp='Title'.$i;
$temp1=$q->param($temp);
print FILE "
- $temp1\n";
}
print FILE "
";
print FILE "
Generated by What's Playing 1.2 for Winamp 3.0";
close FILE;
exit 1;