HTTP::Proxy::BodyFilter::htmltext(3pm)

HTTP::Proxy::BodyFilter::htmltext3pm

A filter to transmogrify html text

Usage

    use HTTP::Proxy::BodyFilter::tags;
    use HTTP::Proxy::BodyFilter::htmltext;
    # could it be any simpler?
    $proxy->push_filter(
        mime     => 'text/html',
        response => HTTP::Proxy::BodyFilter::tags->new,
        response => HTTP::Proxy::BodyFilter::htmltext->new(
            sub { tr/a-zA-z/n-za-mN-ZA-M/ }
        )
    );

Overview

The HTTP::Proxy::BodyFilter::htmltext is a filter spawner that calls the callback of your choice on any HTML text (outside "<script>" and "<style>" tags, and entities).

The subroutine should modify the content of $_ as it sees fit. Simple, and terribly efficient.

Methods

The filter defines the following methods, called automatically:

init()

Ensures that the filter is initialised with a CODE reference.

begin()

Per page parser initialisation.

filter()

A simple HTML parser that runs the given callback on the text contained in the HTML data. Please look at HTTP::Proxy::BodyFilter::htmlparser if you need something more elaborate.

Releases

11 releases since Debian 3.1 (Sarge); the text changed 8 times.

  1. 3.1
  2. 4.0
  3. 5.0
  4. 6.0
  5. 7
  6. 8
  7. 9
  8. 10–11
  9. 12–13

Author

Philippe "BooK" Bruhat, <[email protected]>.

License

This module is free software; you can redistribute it or modify it under the same terms as Perl itself.

From libhttp-proxy-perl 0.304-5 in Debian 13 (Trixie). Parsed by carta from the page's man source.