-
-
Save jberger/2bddc3e21067abfef234 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use Mojo::Base -strict; | |
use Mojo::UserAgent; | |
use Mojo::IOLoop; | |
my $ua = Mojo::UserAgent->new(max_redirects => 10); | |
my $delay = Mojo::IOLoop->delay(sub { | |
my $delay = shift; | |
say $_->req->url . " -> " . $_->res->code for @_; | |
}); | |
$ua->get('http://slashdot.org' => $delay->begin); | |
$ua->get('https://www.google.com' => $delay->begin); | |
$ua->get('http://www.cnn.com' => $delay->begin); | |
$delay->wait; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment