Paste number 61379: What I tried to do with AddedContent.pm

Paste number 61379: What I tried to do with AddedContent.pm
Pasted by: sylvar
When:1 year, 1 month ago
Share:Tweet this! | http://paste.lisp.org/+1BCZ
Channel:#openils-evergreen
Paste contents:
Raw Source | XML | Display As
# returns an HTTP::Response object
sub get_url {
    my( $self, $url ) = @_;

    $logger->info("added content getting [timeout=$net_timeout, errors_remaining=$error_countdown] URL = $url");
    my $agent = LWP::UserAgent->new(timeout => $net_timeout);

    my $res = $agent->get($url);
    $logger->info("added content request ($url) returned with code " . $res->code);

    # If getting the added content fails, try supplying a 1x1 transparent GIF.
    if !($res->is_success) { $res = $agent->get($ac_data->{blank_url}); }

    # "If at first you don't succeed, try, try again.  Then quit.  No use being a damn fool about it." -- WC Fields
    die "added content request failed: " . $res->status_line ."\n" unless $res->is_success;

    return $res;
}

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.