[Zope] importFromURL not working?
Evan Simpson
evan@4-am.com
Fri, 07 Jan 2000 09:12:51 -0600
Timothy Wilson wrote:
> lynx -source http://localhost/headlines/Zope.org/importFromURL?url=\
> http://www.zope.org/SiteIndex/news.rss
[snip]
> http://www.moreover.com/cgi-local/page?index_environment+rss
>
> I know the file itself isn't the problem because I saved it to a local
> disk with a different name and it imported fine. Ideas?
How are you specifying it in your cron file? Looking at the two lines above,
I can see a potential problem if you are writing:
lynx -source http://localhost/headlines/Zope.org/importFromURL?url=\
http://www.moreover.com/cgi-local/page?index_environment+rss
...since this will give you a URL with two '?' in it, and that'll break one
way or another. You can try URL-quoting the address, but passing one URL as
a query argument to another is inherently fragile. Have you considered
packing up all of your fetches into a single DTML Method '/headlines/getAll'
along the lines of:
<dtml-with Zope.org><dtml-call expr="importFromURL(this(), REQUEST,
url='http://www.zope.org/SiteIndex/news.rss')"></dtml-with>
<dtml-with moreover><dtml-call expr="importFromURL(this(), REQUEST,
url='http://www.moreover.com/cgi-local/page?index_environment+rss')"></dtml-with>
... etc
Then, in your cron file, just do:
lynx -source http://localhost/headlines/getAll
Cheers,
Evan @ 4-am