1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
use strict;
use warnings;
use lib qw( ./lib ../lib );
use Cwd;
use CSS::Inliner;
my $url = shift || 'http://www.cpan.org/index.html';
my $inliner = CSS::Inliner->new({ post_fetch_filter => \&post_fetch_filter });
$inliner->fetch_file({ url => $url });
my $inlined = $inliner->inlinify();
warn "================ FINAL HTML ===============";
print $inlined;
warn "================ ERRORS ===============";
foreach my $warning (@{$inliner->content_warnings}) {
warn $warning;
}
sub post_fetch_filter {
my ($params) = @_;
warn "execute filter";
return $$params{html};
};
|