Robin Berjon

For Whom The Belle Trolls

Bridges to the Offline Web

AppCache to Widget Converter (ac2wgt)

The way this converter (announced in this blog post) operates is rather trivial: it fetches the HTML document that has a manifest, then its manifest, then all the files listed there, generates a configuration document that matches that information (including network white list), and crams all of that into a zip archive with the right name and structure. Currently the primary AppCache feature that it doesn't support is fallback. It has two widget backends: W3C (the default) and Opera.

If you're interested in toying with it, please download this archive (currently at version 0.01). This is distributed under the Artistic License 2.0. Use at your own risk. This is produced by myself and not as part of my consulting contract with Vodafone.

You will need to have Perl (tested on 5.10, very likely to work on 5.8, perhaps even on 5.6), as well as the following dependencies:

  • Moose
  • MooseX::Getopt
  • URI
  • LWP::Simple
  • Archive::Zip
  • HTML::Parser
  • XML::LibXML

Usage is simple:

./ --uri http://host/path/to/appcached.html --widget widget-name --format [W3C | Opera]

If all goes well that should generate a widget of that name in the current directory. If you're looking for an example with which to toy (AppCache isn't largely deployed at this point) you can try Mark Finkle’s offline Todo example which is what I've been testing with.