Redirect without displaying page
Hello all, I am trying to integrate our systems with an external email list company. They provide a URL with various arguments relating to email address, first name, last name etc. I need to be able to call (from a python script) the external URL with arguments as if it were a function. I do not want to display the results of the call, other than to validate that the call succeeded. How do I go about achieving this? Is there a python method for doing this? Cheers, Jack Hughes OPENXTRA Ltd. http://www.openxtra.com/
The first thing that comes to mind is calling wget with an external method. Im not even sure if you HAVE to have an external method to call wget, just that i used one when i did it. --- Jack Hughes <jack@openxtra.com> wrote:
Hello all,
I am trying to integrate our systems with an external email list company. They provide a URL with various arguments relating to email address, first name, last name etc.
I need to be able to call (from a python script) the external URL with arguments as if it were a function. I do not want to display the results of the call, other than to validate that the call succeeded. How do I go about achieving this? Is there a python method for doing this?
Cheers,
Jack Hughes OPENXTRA Ltd. http://www.openxtra.com/
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Jack Hughes wrote at 2003-8-28 16:37 +0100:
I am trying to integrate our systems with an external email list company. They provide a URL with various arguments relating to email address, first name, last name etc.
I need to be able to call (from a python script) the external URL with arguments as if it were a function. I do not want to display the results of the call, other than to validate that the call succeeded. How do I go about achieving this? Is there a python method for doing this?
Look at Python's "urllib". You must use it in an External Method or allow importing and using the module for Python Scripts (--> PythonScripts/README.txt). Dieter
I am trying to integrate our systems with an external email list company. They provide a URL with various arguments relating to email address, first name, last name etc.
I need to be able to call (from a python script) the external URL with arguments as if it were a function. I do not want to display the results of the call, other than to validate that the call succeeded. How do I go about achieving this? Is there a python method for doing this?
What I would do: 1. Create an external method that takes as arguments the parameters you want to use in constructing your URL. 2. Do so. 3. Use urllib, urllib2, or call wget or curl to visit that URL. Best bet is urllib2, I think. 4. If it gives you a reasonable status code, return whatever value makes sense for success. Otherwise, do opposite. You can then call this External Method from anywhere in Zope, and nothing will care what is going on behind-the-scenes. --jcc
participants (4)
-
Declan Shanaghy -
Dieter Maurer -
J Cameron Cooper -
Jack Hughes