[Zope] include from an external server
Paul Winkler
pw_lists@slinkp.com
Mon, 18 Nov 2002 20:21:17 -0800
On Mon, Nov 18, 2002 at 08:58:40PM -0500, lee doolan wrote:
>
>
> extreme newbie here...
>
> I have a need to insert a small snippet of html from an external server. I used to do this in php like this:
>
> (include "http://server.com/request?param=arg+string"")
>
> can someone tell me how to do this using ZPT?
There's no built-in equivalent.
You need a method that fetches the data, then
you can include like anything else, e.g.
<span tal:content="here/some_method_that_fetches_stuff">
remote stuff here
</span>
THe method can be either an external method you
write yourself (i've done this using python's
httplib library), or try KebasData
(google for it). I haven't tried it yet,
but KebasData looks quite nice, as you
can grab particular bits of other pages,
as long as you can come up with the right
regular expression (and as long as the
remote site doesn't change enough to break
your regexp.)
--PW
--
Paul Winkler
http://www.slinkp.com
"Welcome to Muppet Labs, where the future is made - today!"