CUFP
jeffa
Here is a quick and dirty little app that will query [http://perladvent.org] for
the module of the day and install it via [cpan://CPAN]. You must have the proper
permissions on your system to actually install the module. Better late then never.
:)
<code>
use strict;
use warnings;
use CPAN;
use Time::Piece;
use LWP::Simple;
use Data::Dumper;
use HTML::TokeParser::Simple;
use Lingua::EN::Numbers::Ordinate;
use constant YEAR => 2003;
my $time = localtime;
unless ($time->year == YEAR && $time->mon == 12 && $time->mday < 25) {
die "today does not have module\n";
}
my $day = ordinate($time->mday);
my $html = get("http://perladvent.org/@{[YEAR]}/$day");
my $p = HTML::TokeParser::Simple->new(\$html);
while (my $t = $p->get_token) {
if ($t->is_start_tag('div')) {
my $attr = $t->return_attr;
if (defined $attr->{class} && $attr->{class} eq 'moduletitle') {
$t = $p->get_token;
CPAN::Shell->install($t->as_is);
}
}
}
</code>
<p>
UPDATE:<br/>
[Podmaster]++ >:)
</p>
<div class="pmsig"><div class="pmsig-18800">
<p>jeffa</p>
<font size=1>
<pre>
L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(<a href="http://jeffa.perlmonk.org/tripdid.mp3">the triplet paradiddle with high-hat</a>)
</pre></font>
</div></div>