Data-Downloader

 view release on metacpan or  search on metacpan

lib/Data/Downloader/Feed.pm  view on Meta::CPAN

our $defaultNamespaceURI;  # set once per execution; default namespace for items in feeds.
                           # "http://purl.org/rss/1.0/"

sub _get_from_xpath {
    my $self = shift;
    my ($xp,$context,$xpath) = @_;
    my $xpc = XML::LibXML::XPathContext->new($context);
    $xpc->registerNs(default => $defaultNamespaceURI) if $defaultNamespaceURI;
    my $value = $xpc->findvalue($xpath);
    TRACE "got $value from $xpath";
    LOGDIE "Got 'Bad credentials' for feed ".$self->name if $value && $value eq "Bad credentials";
    return $value;
}

sub _make_unique_filename {
    my $self = shift;
    return sprintf("%010d%06d%08d%06d",gettimeofday(),$$,int rand 1_000_000);
}

=head1 METHODS

lib/Data/Downloader/Feed.pm  view on Meta::CPAN

 - download : download the files, too?
 - fake : do a fake download?
 - from_file : use this file instead of the live feed?
 - any variables in the feed_template for this feed

Refreshing a feed may also :
 - remove files which are now obolete (because the feed has a urn for a different file)
 - update the symlinks for files whose metadata has changed

Also if both "user" and "password" are passed, they are treated specially
and sent as HTTP Basic auth credentials for the rss feed.

=cut

sub refresh {
    my $self = shift;

    my %args_tmp = @_;
    my $args;
    our $defaultNamespaceURI;



( run in 0.230 second using v1.01-cache-2.11-cpan-4d50c553e7e )