init III
This commit is contained in:
35
Perl music-map/mm.pl
Normal file
35
Perl music-map/mm.pl
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
|
||||
my $s="metallica";
|
||||
my %bands;
|
||||
|
||||
my $i=1;
|
||||
my $l=$i+2;
|
||||
|
||||
cr("$s", $i);
|
||||
|
||||
sub cr {
|
||||
my ($s, $i) = @_;
|
||||
return if ($i == $l);
|
||||
my @r=`wget http://www.music-map.com/$s -O - 2>&1`;
|
||||
foreach my $j (@r) {
|
||||
chomp $j;
|
||||
if ($j =~ /class=S id/) {
|
||||
if ($j !~ /$s/) {
|
||||
my ($b) = $j =~ /\>(.*)\</;
|
||||
#print "$b\n";
|
||||
$bands{"$b"}="$j";
|
||||
cr("$b", $i+1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
my $j=1;
|
||||
print "\n\n\n";
|
||||
foreach my $k (sort keys %bands) {
|
||||
printf "%d %s\n", $j++, $k;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user