Couple of ways to do it: easiest is to embed an invisible 1x1 image in the bottom corner, and make it your external URL. second easiest is to do the naive urllib.urlopen approach - no timeouts, anything like that you could also do this with a timeout - you have to do some of it yourself, using select.select - I can post some code for this if you like. Anthony
"Brendon Grunewald" wrote Dear Zopistas,
Quick Question: I need to ping an external url, but do not want the customer to click a submit button or something similar. i.e. if a certain page is viewed, I want to ping an HTTP API on another server in the following format: "http://www.sp.com/api/@param=abc". Depending on the parameter sent to them, I either need to store the result returned or ignore it and carry on regardless. This is similar to the way counters work, but I would prefer not using Javascripts. Is there a zope solution. <dtml-call ...> does not seem to work for external urls.
Any assistance much appreciated...
Regards, Brendon
--- Brendon Grunewald
www.70South.com: - Interactive and updated daily with the latest news and information on Antarctica and related topics. - Available on your PC, Mobile Phone and PDA. - The No.1 source for Antarcticles (tm)
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- Anthony Baxter <anthony@interlink.com.au> It's never too late to have a happy childhood.
Anthony Baxter wrote:
easiest is to embed an invisible 1x1 image in the bottom corner, and make it your external URL.
Although technically you do get a broken image on your page if you do this.
second easiest is to do the naive urllib.urlopen approach - no timeouts, anything like that
you could also do this with a timeout - you have to do some of it yourself, using select.select - I can post some code for this if you like.
IIRC, there's a timeout module you can import floating aroudn somewhere... cheers, Chris
* Chris Withers <chrisw@nipltd.com> [011012 14:13]:
second easiest is to do the naive urllib.urlopen approach - no timeouts, anything like that
you could also do this with a timeout - you have to do some of it yourself, using select.select - I can post some code for this if you like.
IIRC, there's a timeout module you can import floating aroudn somewhere...
I've done timeouts using signals, too. I *think* the signal module is cross platform. seb
On Fri, 12 Oct 2001 15:10:08 +0100, seb bacon <seb@jamkit.com> wrote:
* Chris Withers <chrisw@nipltd.com> [011012 14:13]:
second easiest is to do the naive urllib.urlopen approach - no timeouts, anything like that
you could also do this with a timeout - you have to do some of it yourself, using select.select - I can post some code for this if you like.
IIRC, there's a timeout module you can import floating aroudn somewhere...
I've done timeouts using signals, too. I *think* the signal module is cross platform.
signals wont do *that* job on win32. Toby Dickenson tdickenson@geminidataloggers.com
On Fri, Oct 12, 2001 at 03:10:08PM +0100, seb bacon wrote:
I've done timeouts using signals, too. I *think* the signal module is cross platform.
They are not. And what is worse, signals are dangerous in multithreading programs (Zope is multithreading) - wrong thread can receive signal. Oleg. ---- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
I am not sure if I misunderstood your problem. Since you mentioned about javascript, I guess that you are interested of the "client-side" solution. My suggestion is to use Macromedia Flash instead of javascript. In Flash5, you can use "XML" object to retrieve data from an URL. It also tells you the success or failure of that connection. Further more, you can use FSCommand to pass data from flash movie out to javascript. But this flash movie should be downloaded from the same server with the URL you want to ping "for sake of security". Hope it helps. Iap, Singuan iap@y2FUN.com
participants (6)
-
Anthony Baxter -
Chris Withers -
iap@y2fun.com -
Oleg Broytmann -
seb bacon -
Toby Dickenson