# getlog.pl require HTTP::Headers; require HTTP::Request; require LWP::UserAgent; $user = "yourID"; $password = "yourPASSWORD"; #$proxy = "http://yourPROXY:8080/"; $url = "http://analyzer.fc2.com"; $path = "/usr/kw.cgi?y=2007&m=2&d=22&pid=0"; # 2007/2/22、全てのページ #$path = "/usr/kw.cgi?y=2007&m=2&d=0&pid=0"; # 2007/2、全てのページ $ua = LWP::UserAgent->new; $ua->proxy('http', $proxy) if defined $proxy; $ua->default_header('Cookie' => "an_user=$user; an_pwd=$password"); do { $request = HTTP::Request->new(GET => "$url$path"); $response = $ua->request($request); die $response->status_line if !($response->is_success); $path = ""; @doc = split (/\n/, $response->content); while ($_ = shift @doc) { if (/

サーチワード<\/h3>/) { $skip = 0; while ($_ = shift @doc) { last if /<\/table>/; if (/]*)>/) { $skip = ($1 =~ /header/); } if ((! $skip) && /]*>(.*)<\/td>/) { $item = $1; $item =~ s/<[^>]*>//g; print "$item\t"; } if (/<\/tr>/) { print "\n" if (! $skip); $skip = 0; } } while ($_ = shift @doc) { if (/href="([^"]+)".+次へ/) { $path = $1; last; } } } } } while ($path ne "");