Alexis Sukrieh > Dancer > wallflower

Download:
Dancer-1.3071.tar.gz

Annotate this POD

Website

View/Report Bugs
Source   Latest Release: Dancer-1.3079_05

NAME ^

wallflower - Sorry I can't dance, I'm hanging on to my friend's purse

SYNOPSIS ^

 wallflower [options]

OPTIONS ^

 --application <name>       Name of the Dancer application
 --destination <path>       Destination directory for the files

 --include     <path>       Library paths to include
 --environment <name>       Application environment (default: production)
 --index       <filename>   Default name for index file (default: index.html)
 --log         <level>      Dancer log level (default: warning)
 --vhost       <vhost>      Default vhost, enforce vhost dir creation

 --help                     Print a short online help and exit
 --manual                   Print the full manual page and exit

DESCRIPTION ^

wallflower turns your Dancer application into a static web site.

While not suitable for all applications, there are a number of use cases where this makes sense. Most web sites are in essence static. Without a way for user to update information on the site (via forms, comments, etc) the only changes in the web site come from sources that you control (including the database) and that are accessible in your development environment.

Using Dancer for a static web site actually makes a lot of sense, just because if gives you access to all the features of the framework for that site. Think of it as extreme caching.

So, forms could be processed on your development server (e.g. to update a local database), and the pages to be published would be a subset of all the URL that the application supports.

Turning such an application into a real static site (a set of pages to upload to a static web server) is just a matter of generating all possible URL for the static site and saving them to files.

wallflower does exactly that. It reads a list of URL, strips them from their query strings, turn them into GET requests and saves the body response to a file whose name matches the request pathinfo.

wallflower is not a generic offline browsing tool.

EXAMPLE ^

The web site created by dancer -a mywebapp is the perfect example. The complete list of URL needed to view the site is:

    /
    /css
    /css/error.css
    /css/style.css
    /favicon.ico
    /images/perldancer-bg.jpg
    /images/perldancer.jpg
    /javascripts/jquery.js

Passing this list to wallflower gives the following result:

    $ wallflower -a mywebapp -d /tmp/output urls.txt
    200 / => /tmp/output/index.html [5257]
    200 /css/error.css => /tmp/output/css/error.css [1210]
    200 /css/style.css => /tmp/output/css/style.css [2972]
    200 /favicon.ico => /tmp/output/favicon.ico [1406]
    200 /images/perldancer-bg.jpg => /tmp/output/images/perldancer-bg.jpg [7125]
    200 /images/perldancer.jpg => /tmp/output/images/perldancer.jpg [2240]
    200 /javascripts/jquery.js => /tmp/output/javascripts/jquery.js [72174]

Note that URL with a path ending with a / or a name without an extension will be considered to be a directory, and have the default "index" filename appended.

Any URL resulting in a status different than 200 will be logged, but not saved:

    404 /css
    500 foo/bar

AUTHOR ^

Philippe Bruhat (BooK)

LICENSE ^

This program is free software and is published under the same terms as Perl itself.

syntax highlighting: