NAME
WWW::Crawler::Mojo::UserAgent - Mojo::UserAgent sub class for userinfo storage
SYNOPSIS
my $ua = WWW::Crawler::Mojo::UserAgent->new;
$ua->keep_credentials(1);
$ua->credentials->{'http://example.com:80'} = 'jamadam:password';
my $tx = $ua->get('http://example.com/');
say $tx->req->url # http://jamadam:passowrd@example.com/
DESCRIPTION
This class inherits Mojo::UserAgent and override start method for storing user info
ATTRIBUTES
WWW::Crawler::Mojo::UserAgent inherits all attributes from Mojo::UserAgent.
active_conn
A number of current connections.
$bot->active_conn($bot->active_conn + 1);
say $bot->active_conn;
active_conns_per_host
A number of current connections per host.
$bot->active_conns_per_host($bot->active_conns_per_host + 1);
say $bot->active_conns_per_host;
keep_credentials
Set true to set the feature on, defaults to 1.
$ua->keep_credentials(1);
credentials
Storage for credentials.
$ua->credentials->{'http://example.com:80'} = 'jamadam:password';
METHODS
WWW::Crawler::Mojo::UserAgent inherits all methods from Mojo::UserAgent.
active_host
Maintenance the numbers of active connections.
$ua->active_host($url, 1);
$ua->active_host($url, -1);
my $amount = $ua->active_host($url);
new
Constructer.
$ua = WWW::Crawler::Mojo::UserAgent->new;
AUTHOR
Sugama Keita, <sugama@jamadam.com>
COPYRIGHT AND LICENSE
Copyright (C) Sugama Keita.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.