2008-07-20T20:29:01+09:00

まえに友達の家で見た松岡修造のビデオ、あれ公式サイトにあったのかー。

use strict;
use warnings;

use Web::Scraper;
use URI;
use LWP::Simple;

sub non_flv_files {
    my ($uri) = @_;

    my $scraper = scraper {
        process '//select[@name="mySel"]/option', 'links[]' => '@value'
    };

    grep {
        $_ && $_ !~ /^javascript:/
    } @{ $scraper->scrape(URI->new($uri))->{links} };
}

sub flv_files {
    my ($uri) = @_;

    my $html = LWP::Simple::get($uri);
    my @result;
    while ($html =~ m{message/shuzo(\d+)\.html}g) {
        push @result, "http://www.shuzo.co.jp/video/matsuoka/matsuoka_$1.flv";
    }
    @result;
}

map {
    print "$_\n";
} (non_flv_files('http://www.shuzo.co.jp/contents.htm'),
   flv_files('http://www.shuzo.co.jp/_js/js.js'));

小西真奈美の「今日の大丈夫。」をちょっと思い出した。