how can I dynamically bring in external page
What I want to do is have a page served by zope which is in fact on another non Zope server but to do this dynamically with dynamic pages, not just by pasting the html. The actual pages I want to bring in are HyperNews discussion pages. Best of all would be able to serve a HyperNews discussion page as part of a table. All advice welcome. Andy -- ------------------------------------------------- Andy Heath a.k.heath@open.ac.uk The Open University +44 (0) 114 2885738
Hi Andy - I am not usre what you by dynamic and not pasting. I suppose you need a method to automatically retrieve an HTML page from a server. An external method might be appropriate (untested): import urllib try: content=urllib.urlopen(URL) except: return "Not available" return content URL can be acquired or passed as an argument to your external method ... Regards Pavlos On Mon, 28 Feb 2000, Andy Heath wrote:
What I want to do is have a page served by zope which is in fact on another non Zope server but to do this dynamically with dynamic pages, not just by pasting the html.
The actual pages I want to bring in are HyperNews discussion pages. Best of all would be able to serve a HyperNews discussion page as part of a table.
All advice welcome.
Andy
-- ------------------------------------------------- Andy Heath a.k.heath@open.ac.uk The Open University +44 (0) 114 2885738
_______________________________________________ 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 )
Andy, Put this into an external method, it might give you a nudge in the right direction: import httplib def getfilebyurl(self=None): h=httplib.HTTP('<host address>') h.putrequest('GET', '/index_html') h.putheader('Accept', 'text/html') h.putheader('Accept', 'text/plain') h.endheaders() errcode, errmsg, headers = h.getreply() print errcode # Should be 200 f = h.getfile() data = f.read() # Get the raw HTML f.close() return data HTH As an aside, sort of just to let you know you aren't the only one using zope in UK academia, give us a ring if you need anything else. Phil phil.harris@zope.co.uk harrisp2@cf.ac.uk tel: 01222 744156 ----- Original Message ----- From: "Andy Heath" <a.k.heath@open.ac.uk> To: <zope@zope.org> Sent: Monday, February 28, 2000 12:01 AM Subject: [Zope] how can I dynamically bring in external page
What I want to do is have a page served by zope which is in fact on another non Zope server but to do this dynamically with dynamic pages, not just by pasting the html.
The actual pages I want to bring in are HyperNews discussion pages. Best of all would be able to serve a HyperNews discussion page as part of a table.
All advice welcome.
Andy
-- ------------------------------------------------- Andy Heath a.k.heath@open.ac.uk The Open University +44 (0) 114 2885738
_______________________________________________ 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 )
Have you seen the How-To: Using ZClient to Access Another Server at http://www.zope.org/Members/lstaffor/ZClientMethod? Also, there used to be an XML-based syndication product, but I can't find it right now. -- Loren ----- Original Message ----- From: Andy Heath <a.k.heath@open.ac.uk> To: <zope@zope.org> Sent: February 27, 2000 04:01 PM Subject: [Zope] how can I dynamically bring in external page
What I want to do is have a page served by zope which is in fact on another non Zope server but to do this dynamically with dynamic pages, not just by pasting the html.
The actual pages I want to bring in are HyperNews discussion pages. Best of all would be able to serve a HyperNews discussion page as part of a table.
All advice welcome.
Andy
-- ------------------------------------------------- Andy Heath a.k.heath@open.ac.uk The Open University +44 (0) 114 2885738
_______________________________________________ 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 )
RSS syndication product Site Summary http://www.zope.org/Members/edmundd/SiteSummary Don't know if HyperNews does RSS.
Have you seen the How-To: Using ZClient to Access Another Server at http://www.zope.org/Members/lstaffor/ZClientMethod?
Also, there used to be an XML-based syndication product, but I can't find it right now.
From: Andy Heath <a.k.heath@open.ac.uk>
What I want to do is have a page served by zope which is in fact on another non Zope server but to do this dynamically with dynamic pages, not just by pasting the html.
The actual pages I want to bring in are HyperNews discussion pages. Best of all would be able to serve a HyperNews discussion page as part of a table.
All advice welcome.
Andy
participants (4)
-
Andy Heath -
Loren Stafford -
Pavlos Christoforou -
Phil Harris