From 604af5b7b25637902595d77841de832aa5ee9ab3 Mon Sep 17 00:00:00 2001 From: fredrik Date: Fri, 5 Aug 2005 00:30:32 +0000 Subject: [PATCH] Extract type from the name. git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/utils@304 959494ce-11ee-0310-bf91-de5d638817bd --- ANN.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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([^<]+)