GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
HTTP::Proxy::BodyFilter::htmltext(3) User Contributed Perl Documentation HTTP::Proxy::BodyFilter::htmltext(3)

HTTP::Proxy::BodyFilter::htmltext - A filter to transmogrify HTML text

    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/ }
        )
    );

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.

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.

HTTP::Proxy, HTTP::Proxy::BodyFilter, HTTP::Proxy::BodyFilter::htmlparser.

Philippe "BooK" Bruhat, <book@cpan.org>.

Copyright 2003-2015, Philippe Bruhat.

This module is free software; you can redistribute it or modify it under the same terms as Perl itself.
2015-06-16 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.