WWW::Flatten - Flatten a web pages deeply and make it portable
use strict; use warnings; use utf8; use 5.010; use WWW::Flatten; my $basedir = './github/'; mkdir($basedir); my $bot = WWW::Flatten->new( basedir => $basedir, max_conn => 1, max_conn_per_host => 1, depth => 3, filenames => { 'https://github.com' => 'index.html', }, is_target => sub { my $uri = shift->resolved_uri; if ($uri =~ qr{\.(css|png|gif|jpeg|jpg|pdf|js|json)$}i) { return 1; } if ($uri->host eq 'assets-cdn.github.com') { return 1; } return 0; }, normalize => sub { my $uri = shift; ... return $uri; } ); $bot->crawl;
WWW::Flatten is a web crawling tool for freezing pages into standalone.
This software is considered to be alpha quality and isn't recommended for regular usage.
Sugama Keita, <sugama@jamadam.com>
Copyright (C) jamadam
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install WWW::Flatten, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Flatten
CPAN shell
perl -MCPAN -e shell install WWW::Flatten
For more information on module installation, please visit the detailed CPAN module installation guide.