[Zope] Including HTML from another server's file into a dtml method or document

Andreas Jung Andreas Jung" <andreas@andreas-jung.com
Wed, 1 Aug 2001 19:37:16 -0500


Write an external method takes the url as argument and use
the urllib module to fetch the URL and returns its content.
Something like that (untested) should work:

def fetchurl(url):
    import urllib
    return urllib.urlopen(url).read()

and inside DTML you can use
<dtml-var "fetchurl('http://www.zope.org')">

Andreas

----- Original Message -----
From: "Tommy Johnson" <tommy@7x.com>
To: "Zope List" <zope@zope.org>
Sent: Mittwoch, 1. August 2001 18:38
Subject: [Zope] Including HTML from another server's file into a dtml method
or document


> Hey all,
>
> Does anyone know how to include a file from another server into a dtml
> method or doc? The 'other' server can be the local file system, or (what I
> want) another server out there. I want to be able to grab the html from
the
> file and display it in my dtml method.
>
> Something similiar to ColdFusion's <CFHTTP> tag. Maybe a simple syntax or
a
> product could do this? Send me all ideas you have. I'd appreciate it. I
> tried searching the EGroups Zope archive, but to no avail.
>
> Thanks in advance,
>
> Tommy
>
> Innovation:
> The Best Way To Predict The Future ...
>      Is To Create It.
>
>
> _______________________________________________
> 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 )