Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Perl Advent Calendar Daily Installer

by PodMaster (Abbot)
on Dec 07, 2003 at 17:29 UTC ( #312948=note: print w/replies, xml ) Need Help??


in reply to Perl Advent Calendar Daily Installer

This is a tad friendlier to the server
use strict; use warnings; use LWP::Simple 'get'; use XML::Simple; use CPAN; my $xml = XMLin( get( 'http://perladvent.org/perladvent.rdf' ) ); my $item = shift @{ $xml->{channel}{item} }; CPAN::Shell->install($1) if $item->{title} =~ /-\s(\S+)$/;
update: and here is the friendliest version possible
use strict; use warnings; use LWP::Simple 'get'; use XML::Simple; use CPAN; CPAN::Shell->install( XMLin( get( 'http://perladvent.org/perladventone.rdf' ) ) ->{channel}{item}{title} );

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re^2: Perl Advent Calendar Daily Installer
by Aristotle (Chancellor) on Dec 08, 2003 at 12:54 UTC
    And for those of us who like to avoid the expat-based modules and prefer libxml2:
    use strict; use warnings; use LWP::Simple 'get'; use XML::LibXML; use CPAN; CPAN::Shell->install( XML::LibXML ->new() ->parse_string( get( 'http://perladvent.org/perladventone.rdf' + ) ) ->findvalue( '/rss/channel/item/title' ) );
    Actually for the RDF feed currently provided you can just use //title as the XPath expression.

    Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://312948]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2021-01-18 08:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?