X-Git-Url: http://dolda2000.com/gitweb/?p=utils.git;a=blobdiff_plain;f=ANN.pm;h=1406c4584045c8f4d636875d9ac481aa7166f38e;hp=b2c3db3c71b84af168ed058d9008d4dde6b68aa8;hb=3e60094e9bdf9494bcddb4ebc036e39ae5d9b5ce;hpb=ed5f0d8889c1f3c3a772977c85a18cf31527d379 diff --git a/ANN.pm b/ANN.pm index b2c3db3..1406c45 100644 --- a/ANN.pm +++ b/ANN.pm @@ -57,7 +57,12 @@ sub getlist # The only way to recognize entries that seems sure is to look # after the "HOVERLINE" class. - push @ret, $1 while $html =~ /.*([^<>]*$name[^<>]*)<\/FONT/ig; + while($html =~ /([^<]+)<\//ig) { + if((substr "" . lc $2 , 0, length $name) eq lc $name) { + push @ret, $2; + } + } + # push @ret, $1 while $html =~ /.*([^<>]*$name[^<>]*)<\/FONT/ig; return @ret; } @@ -76,9 +81,13 @@ sub getid # The only way to recognize entries that seems sure is to look # after the "HOVERLINE" class. - (($url) = ($html =~ /([^<]+)<\//ig) { + if((substr "" . lc $2 , 0, length $name) eq lc $name) { + return ($1 =~ /id=(\d+)$/)[0]; + } + } - return ($url =~ /\?id=(\d+)$/)[0]; + return undef; } sub geturl