1HTTP::Proxy::BodyFilterU:s:ehrtmClotnetxrti(b3u)ted PerlHTDToPc:u:mPernotxayt:i:oBnodyFilter::htmltext(3)
2
3
4
6 HTTP::Proxy::BodyFilter::htmltext - A filter to transmogrify HTML text
7
9 use HTTP::Proxy::BodyFilter::tags;
10 use HTTP::Proxy::BodyFilter::htmltext;
11
12 # could it be any simpler?
13 $proxy->push_filter(
14 mime => 'text/html',
15 response => HTTP::Proxy::BodyFilter::tags->new,
16 response => HTTP::Proxy::BodyFilter::htmltext->new(
17 sub { tr/a-zA-z/n-za-mN-ZA-M/ }
18 )
19 );
20
22 The HTTP::Proxy::BodyFilter::htmltext is a filter spawner that calls
23 the callback of your choice on any HTML text (outside "<script>" and
24 "<style>" tags, and entities).
25
26 The subroutine should modify the content of $_ as it sees fit. Simple,
27 and terribly efficient.
28
30 The filter defines the following methods, called automatically:
31
32 init()
33 Ensures that the filter is initialised with a CODE reference.
34
35 begin()
36 Per page parser initialisation.
37
38 filter()
39 A simple HTML parser that runs the given callback on the text con‐
40 tained in the HTML data. Please look at HTTP::Proxy::BodyFil‐
41 ter::htmlparser if you need something more elaborate.
42
44 HTTP::Proxy, HTTP::Proxy::BodyFilter, HTTP::Proxy::BodyFilter::html‐
45 parser.
46
48 Philippe "BooK" Bruhat, <book@cpan.org>.
49
51 Copyright 2003-2005, Philippe Bruhat.
52
54 This module is free software; you can redistribute it or modify it
55 under the same terms as Perl itself.
56
57
58
59perl v5.8.8 2006-09-0H4TTP::Proxy::BodyFilter::htmltext(3)