HTML::Munger

HTML::Munger is a Perl module which simplifies the creation of web filters.
Download

HTML::Munger Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • J. David Lowe
  • Publisher web site:
  • http://search.cpan.org/~dlowe/DBIx-Table-0.04/Table.pm

HTML::Munger Tags


HTML::Munger Description

HTML::Munger is a Perl module which simplifies the creation of web filters. HTML::Munger is a Perl module which simplifies the creation of web filters.SYNOPSIS use HTML::Munger; $munger = new HTML::Munger; $munger->set_munger(&filter_function); $output = $munger->munge($URL, $selfURL, $input);HTML::Munger is a simple module which allows easy creation of web page filtering software. It was first written to build the pootifier at http://pootpoot.com/?pootifyThe main task which this module performs is attempting to make all the relative links on the filtered page absolute, so that images, and hyperlinks work correctly. It also makes frames and hyperlinks properly filter back through the filter.This leaves two major tasks for the user of HTML::Munger: fetching the original page, and building a simple munging function.APIThere are really only three important functions you need to know how to call in order to use this module:newThis is a simple constructor, which takes no arguments aside from the implicit class. It returns a blessed reference which is used to call the other methods.set_mungerThis method registers the filtering function you want to be called to produce the filtered text. The function specified will be called repeatedly with short blocks of text. For example, given the following HTML:< P >Hello< /P >< CENTER >The quick brown < I >fox< /I >< /CENTER >The filtering function would be called three times, with 'Hello', 'The quick brown ', and 'fox', respectively, as input. The filter function is expected to return a string which will replace the given input in the output of the munge() call.mungeThis method takes three arguments. The first is the URL of the page which is being munged. Note that the 'munge' method does NOT fetch the page for you! It needs this information in order to make relative links in the page absolute. The second argument is the URL of the filtering program. This is used to make all hyperlinks and frames pass back through the filter. Finally, it takes the input HTML as its third argument. This method returns the munged HTML string, which can then be further parsed or sent to the user. Requirements: · Perl


HTML::Munger Related Software