Mojolicious::Command::bulkget - Perform bulk get requests
Usage: APPLICATION bulkget urlbase outdir suffixesfile # suffixes contains lines with 1, 2, 3 # fetches /pets/1, /pets/2, ... # stores results in outputdir/1, outputdir/2, ... mojo bulkget http://example.com/pets/ outputdir suffixes Options: -v, --verbose Print progress information
Mojolicious::Command::bulkget is a command line interface for bulk-fetching URLs.
Each line of the "suffixes" file is a suffix. It gets appended to the URL "base", then a non-blocking request is made. Only 20 requests will be active at the same time. When ready, the result is stored in the output directory with the suffix as the filename.
This command uses the relatively new Mojolicious feature, Promises. The code may be considered worth examining for lessons on what to do, and/or what not to do.
$str = $self->description;
$str = $self->usage;
$get->run(@ARGV);
Run this command.
Ed J
Based heavily on Mojolicious::Command::openapi.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Mojolicious::Command::bulkget, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Command::bulkget
CPAN shell
perl -MCPAN -e shell install Mojolicious::Command::bulkget
For more information on module installation, please visit the detailed CPAN module installation guide.