[Zope] Http API Ping

Anthony Baxter Anthony Baxter <anthony@interlink.com.au>
Thu, 11 Oct 2001 22:49:42 +1000

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.


>>> "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.