return ($url =~ /\?id=(\d+)$/)[0];
}
+sub geturl
+{
+ my($id);
+ ($id) = @_;
+
+ return "http://www.animenewsnetwork.com/encyclopedia/anime.php?id=$id";
+}
+
sub getthemes
{
my($html, $kind, @ret);
$ct = {};
$ct->{"num"} = $parts[1] if defined $parts[1];
if(defined $parts[5]) {
- $ct->{"tit"} = $parts[5];
+ $ct->{"tit"} = decode_entities($parts[5]);
$ct->{"jat"} = decode_entities($parts[2]) if defined $parts[2];
} else {
- $ct->{"tit"} = $parts[2] if defined $parts[2];
+ $ct->{"tit"} = decode_entities($parts[2]) if defined $parts[2];
}
- $ct->{"ent"} = $parts[7] if defined $parts[7];
- $ct->{"prf"} = $parts[8] if defined $parts[8];
+ $ct->{"ent"} = decode_entities($parts[7]) if defined $parts[7];
+ $ct->{"prf"} = decode_entities($parts[8]) if defined $parts[8];
$ct->{"fep"} = $parts[10] if defined $parts[10];
$ct->{"lep"} = $parts[11] if defined $parts[11];
push @ret, $ct;
my($id, $buf, $html, %ret);
($id) = @_;
- $html = _get "http://www.animenewsnetwork.com/encyclopedia/anime.php?id=$id";
+ $html = _get geturl $id;
- $ret{"url"} = "http://www.animenewsnetwork.com/encyclopedia/anime.php?id=$id";
+ $ret{"url"} = geturl $id;
($buf) = ($html =~ /\<TITLE\>Anime News Network - ([^<]*)<\/TITLE>/);
if($buf =~ /\([^\)]+\)$/) {
($ret{"name"}, $ret{"type"}) = ($buf =~ /^(.*[^\s])\s*\(([^\)]+)\)$/);