NAME
App::Wallflower - Class performing the moves for the wallflower program
SYNOPSIS
use App::Wallflower;
my $w = App::Wallflower->new(
application => $app, # a PSGI app
destination => $dir, # target directory
);
# dump all URL from $app to files in $dir
$w->get( $_ ) for @urls;
DESCRIPTION
This module contains the core functionality of the wallflower program, that provides user-friendly functionality.
METHODS
new( %args )
Create a new App::Wallflower object.
The parameters are:
application
-
The PSGI/Plack application, as a CODE reference.
This parameter is required.
destination
-
The destination directory. By default, will use the current directory.
env
-
Additional environment key/value pairs.
index
-
The default file name for URL ending with a
/
. The default value is index.html.
get( $url )
Perform a GET
request for $url
through the application, and in case of success, save the result to a file, whose name is obtained via the target()
method.
$url
may be either a string or a URI object, representing an absolute URL (the path starts with a /
). The scheme, host and port elements are optional. The query string will be ignored.
target( $uri )
Note that target assumes $uri
is a URI object.
ACCESSORS
Accessors (that are both getters and setters) exist for all parameters to new()
and bear the same name.
AUTHOR
Philippe Bruhat (BooK)
COPYRIGHT
Copyright 2010-2012 Philippe Bruhat (BooK), all rights reserved.
LICENSE
This program is free software and is published under the same terms as Perl itself.