[Zope] Dictionary Key Error from Parsed RSS

Tom Von Lahndorff tom at modscape.com
Fri Jun 15 10:18:20 EDT 2007


Hi everyone, I've used Universal Feed Parser to parse an RSS feed.  
Then used these instructions below to get the parsed data into Zope  
via an External Method. Everything seems to work fine except that I  
keep getting an error whenever I try to access a key from the  
returned data. The resulting data is returned as a dictionary and if  
I render it as is it works fine, however in both ZPT and DTML, when  
trying to access a key, for instance "feed" or "href" from the  
dictionary I'm prompted to login, which I'm unable to do with my  
admin login. After hitting cancel I get a Key Error that says You are  
not able to access 'href' (or whatever) in this context. Is there any  
way to somehow let Zope know that this data is 'ok'? Thanks in advance.

"Pre-requisites
==============

- Zope 2.5.x (developed and tested with Zope 2.5.1, but other minor  
versions should work as well)

- feedparser.py 3.0 (http://diveintomark.org/projects/feed_parser/)  
developed and tested with 3.0 beta 22, the latest version

Installation
============

1. Installing feedparser.py
---------------------------

1.1. Unzip the archive (preserving path names) into /Zopesite/bin/lib/

1.2. open a command prompt window and go to /Zopesite/bin/lib/ 
feedparser/

1.3. enter the command (sans quotes): '..\..\python setup.py install'

1.4. after installation, enter the command: '..\..\python  
feedparsertest.py'

1.5. wait for testing to complete. On my laptop, 2051 tests ran in  
118.481s

2. Installing the external method
---------------------------------

2.1 place the newsfeed.py module in the /Zopesite/Extensions/ directory
2.2 Add an external method to your zope site with an id and Module of  
'newsfeed', and a function of 'parsefeed'

3. Installing the feed template
-------------------------------

3.1 Add a Page template to your Zope site with the contents of the  
nprnews.pt Page Template

3.2 examine the generic template rendering of NPR News, all fields  
from the feed should be available."


More information about the Zope mailing list