From 3e60094e9bdf9494bcddb4ebc036e39ae5d9b5ce Mon Sep 17 00:00:00 2001 From: fredrik Date: Wed, 5 Oct 2005 01:16:06 +0000 Subject: [PATCH] Don't search titles with regexes. git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/utils@353 959494ce-11ee-0310-bf91-de5d638817bd --- ANN.pm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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 -- 2.11.0