include from an external server
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? --tia __________________________________________________________ Outgrown your current e-mail service? Get 25MB Storage, POP3 Access, Advanced Spam protection with LYCOS MAIL PLUS. http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus
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!"
On Tuesday 19 November 2002 12:21, Paul Winkler wrote:
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).
KebasData is at www.zope.org/Members/kedai/KebasData there's also a how to use kebasdata, that's recently updated. will soon add ways to use KebasData from PT
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
-- http://www.kedai.com.my/ http://www.kedai.com.my/eZine http://www.zope.org/Members/kedai http://www.my-zope.org Get the Tables!
participants (3)
-
Bakhtiar A Hamid -
lee doolan -
Paul Winkler