use LWP::Simple;                        # this is the package you want to use

my $search_term = $ARGV[0];        # get the seach term from the command line 
die "Specify a search string, please!\n" unless defined $search_term;

# this is the base URL of the search script, with the search term appended
my $url = "http://www.shoutcast.com/directory/?s=$search_term";

# download $url and save its contents in $content 
my $content = get($url); 

# exit if an error occurs
die "I couldn't download $url" unless defined $content; 

# now search inside $content
if ($content =~ m/any SHOUTcast streams found/) { 
    print "No shoutcast streams containing the term $search_term\n"; 
} else {  
    print "Some shoutcast streams contain the term $search_term.\n";
    print "Here are the songs they're playing:\n";
    while ($content =~ /Playing:<\/font>\s(.*?)<\/font>/gs) {
        print $1."\n";
    }
} 
                     	    
