NAME
Wallflower::Util - Utility functions for Wallflower
VERSION
version 1.015
SYNOPSIS
use Wallflower;
use Wallflower::Util qw( links_from );
# use Wallflower to get a response array
my $wf = Wallflower->new( application => $app, destination => $dir );
my $response = $wf->get($url);
# obtain links to resources linked from the document
my @links = links_from( $response, $url );
DESCRIPTION
This module provides methods to extract links from the files produced by Wallflower's get()
method.
FUNCTIONS
links_from
my @links = links_from( $response, $url );
Returns all local, HTTP and HTTPS links found in the response body, depending on its content type.
$response
is the array reference returned by Wallflower's get()
method. $url
is the base URL for resolving relative links, i.e. the original argument to get()
.
AUTHOR
Philippe Bruhat (BooK) <book@cpan.org>
COPYRIGHT AND LICENSE
Copyright 2012-2018 by Philippe Bruhat (BooK).
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.