Need some help hijacking the page output pipe

[prev] [thread] [next] [Date index for 2004/11/11]

From: Mark S Lowe
Subject: Need some help hijacking the page output pipe
Date: 21:30 on 11 Nov 2004
--B_3183024660_8367089
Content-type: text/plain;
	charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable

I have a need to create my own suffix and hijack the output for page
rendering code, and then re-output the page with my own OK. I have the
O=B9Reilly book =B3Practical mod_perl=B2 and there is a great example of this on
page 114 in Chapter 4. However, the example is incomplete. The example
suggests that we can intercept the request for a page, remove all the HTML
tags, and re-output the page. This isn=B9t exactly what I want to do, but it
will server as a great architecture for my needs.

I=B9ve got my <Files> directive working perfectly in httpd.conf, but now I
need some help intercepting the page request event, re-rendering the page,
and then outputting it. I imagine this is like a three line explanation, bu=
t
I can=B9t seem to find it anywhere. I imagine it something like this:

PerlModule MyPlatform::Converter
<Files ~ "\.(pla)$">
    SetHandler perl-script
    PerlHandler MyPlatform::HTML2TextConverter MyPlatform::
HTMLContentGenerator
</Files>

I just don=B9t know how to grab the HTML page text once it gets to my module.
STDIN doesn=B9t have it. So where is it?

Suggestions?

Thanks!

Mark

--B_3183024660_8367089
Content-type: text/html;
	charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable

<HTML>
<HEAD>
<TITLE>Need some help hijacking the page output pipe</TITLE>
</HEAD>
<BODY>
<FONT FACE=3D"Verdana, Helvetica, Arial"><SPAN STYLE=3D'font-size:12.0px'>I hav=
e a need to create my own suffix and hijack the output for page rendering co=
de, and then re-output the page with my own OK. I have the O&#8217;Reilly bo=
ok &#8220;Practical mod_perl&#8221; and there is a great example of this on =
page 114 in Chapter 4. However, the example is incomplete. The example sugge=
sts that we can intercept the request for a page, remove all the HTML tags, =
and re-output the page. This isn&#8217;t exactly what I want to do, but it w=
ill server as a great architecture for my needs. <BR>
<BR>
I&#8217;ve got my &lt;Files&gt; directive working perfectly in httpd.conf, =
but now I need some help intercepting the page request event, re-rendering t=
he page, and then outputting it. I imagine this is like a three line explana=
tion, but I can&#8217;t seem to find it anywhere. I imagine it something lik=
e this:<BR>
<BR>
PerlModule MyPlatform::Converter<BR>
&lt;Files ~ &quot;\.(pla)$&quot;&gt;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;SetHandler perl-script<BR>
&nbsp;&nbsp;&nbsp;&nbsp;PerlHandler MyPlatform::HTML2TextConverter MyPlatfo=
rm:: HTMLContentGenerator <BR>
&lt;/Files&gt;<BR>
<BR>
I just don&#8217;t know how to grab the HTML page text once it gets to my m=
odule. STDIN doesn&#8217;t have it. So where is it?<BR>
<BR>
Suggestions?<BR>
<BR>
Thanks!<BR>
<BR>
Mark</SPAN></FONT>
</BODY>
</HTML>


--B_3183024660_8367089--


Need some help hijacking the page output pipe
Mark S Lowe 21:30 on 11 Nov 2004

Generated at 11:26 on 21 Dec 2004 by mariachi v0.52