11 $ua = LWP::UserAgent->new;
12 $ua->agent("ANNData/0.1");
14 $res = $ua->request(HTTP::Request->new("GET", "$uri"));
16 die "could not fetch $uri\n" unless $res->is_success;
22 my($name, $il, $html, @ret);
25 $il = uc(($name =~ /^(.)/)[0]);
26 $il = "9" if (!($il =~ /[A-Z]/));
27 $html = get "http://www.animenewsnetwork.com/encyclopedia/anime.php?list=$il";
29 # The only way to recognize entries that seems sure is to look
30 # after the "HOVERLINE" class.
32 push @ret, $1 while $html =~ /<A\s.*CLASS=HOVERLINE\s.*>.*<FONT.*>([^<>]*$name[^<>]*)<\/FONT/ig;
39 my($name, $il, $html, $url);
42 $il = uc(($name =~ /^(.)/)[0]);
43 $il = "9" if (!($il =~ /[A-Z]/));
44 $html = get "http://www.animenewsnetwork.com/encyclopedia/anime.php?list=$il";
46 # The only way to recognize entries that seems sure is to look
47 # after the "HOVERLINE" class.
49 (($url) = ($html =~ /<A\s.*CLASS=HOVERLINE\s.*HREF=\"([^\"]+)\".*$name/i)) || return;
51 return((($url =~ /\?id=(\d+)$/)[0]));
59 $html = get "http://www.animenewsnetwork.com/encyclopedia/anime.php?id=$id";
61 return(($html =~ /\<TITLE\>Anime News Network - ([^<]*)<\/TITLE>/)[0]);
64 GetOptions(\%options, ("l"));
67 @list = getlist $ARGV[0];
68 foreach $name (@list) {
74 unless($test = getid $ARGV[0]) {
75 printf STDERR "could not find $ARGV[0]\n";
79 print getnamefromid($test) . "\n";