21 my @opt = <<'=back' =~ /B<--(\S+)>/g;
31 m-l.org/~perl/smoke/perl/... holds one month worth of smokereports.
33 This script fetches a collection of reports and stores them in a
38 This is a one-off script with shortcuts.
42 m-l-smokerpt-parse.pl for parsing the contents.
48 use lib
"$FindBin::Bin/../lib";
54 use File
::Basename
qw(dirname);
55 use File
::Path
qw(mkpath);
59 use Hash
::Util
qw(lock_keys);
62 lock_keys
%Opt, map { /([^=|!]+)/ } @opt;
67 our $DIR_URL = "http://m-l.org/~perl/smoke/perl/linux/blead_clang/";
69 use LWP
::UserAgent
();
72 use Text
::Trim
qw(trim);
76 my $ua = LWP
::UserAgent
->new;
77 my $p = XML
::LibXML
->new;
80 my $resp = $ua->get($DIR_URL);
81 if ($resp->is_success) {
82 my $content = $resp->decoded_content;
83 my $dom = XML
::LibXML
->load_html(string
=> $content);
84 TR
: for my $tr_ele ($dom->findnodes("/html/body/table/tr")){
85 my($filename_attr) = $tr_ele->findnodes("td[2]/a/\@href") or next;
86 my $filename = $filename_attr->value;
87 next TR
unless $filename =~ /^rpt.*\.rpt$/;
88 my $timestamp = $tr_ele->findnodes("td[3]/.");
90 my $resp = $ua->get("$DIR_URL/$filename");
91 if ($resp->is_success) {
92 my $content = $resp->decoded_content;
93 $S->{$filename}{content
} = $content;
94 $S->{$filename}{timestamp
} = $timestamp;
103 my $ts = POSIX
::strftime
"%FT%T", localtime;
104 my $outfile = __FILE__
. "-$ts.out";
105 YAML
::Syck
::DumpFile
($outfile, $S);
109 # cperl-indent-level: 4