From: fredrik Date: Fri, 5 Aug 2005 00:30:32 +0000 (+0000) Subject: Extract type from the name. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=604af5b7b25637902595d77841de832aa5ee9ab3;p=utils.git Extract type from the name. git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/utils@304 959494ce-11ee-0310-bf91-de5d638817bd --- diff --git a/ANN.pm b/ANN.pm index fbf08e5..90bd24a 100644 --- a/ANN.pm +++ b/ANN.pm @@ -92,7 +92,12 @@ sub getseries $html = _get "http://www.animenewsnetwork.com/encyclopedia/anime.php?id=$id"; $ret{"url"} = "http://www.animenewsnetwork.com/encyclopedia/anime.php?id=$id"; - ($ret{"name"}) = ($html =~ /\Anime News Network - ([^<]*)<\/TITLE>/); + ($buf) = ($html =~ /\Anime News Network - ([^<]*)<\/TITLE>/); + if($buf =~ /\([^\)]+\)$/) { + ($ret{"name"}, $ret{"type"}) = ($buf =~ /^(.*[^\s])\s*\(([^\)]+)\)$/); + } else { + $ret{"name"} = $buf; + } if(($buf) = ($html =~ /vintage:<\/b>\n([^<]+)