Meerkat script suddenly fails: output format changed?

Steve Holden sholden at holdenweb.com
Wed Jul 2 05:39:04 CEST 2003


For quite a while now I've been filling part of the navigation-bar on my
home page with Python-related news extracted from O'Reilly's meerkat
service.

I've been experiencing intermittent problems for the past few days, and now
suddenly the crontab-triggered script has stopped working completely,
apparently due to a change in what Meerkat sends in response to my queries.
I've not been able to find any description af changes to Meerkat, but since
my script appears to have been unchanged for over six weeks and this error
has only just appeared, I can only assume this represent searching
ineptitude on my part.

The relevant extracts from the script are:

# Get a list of article categories from the O'Reilly Network
items = server.meerkat.getItems(
    {'search':'/[Pp]ython/','num_items':10,'descriptions':100})

and

print >> out, "<BR>\n".join(
        ["""<A href="%(link)s" class="link" target="news_win">%(title)s</A>
""" % item for item in items]

It's this last statement which is now failing, with a KeyError because
there's no "link" key in the items returned by the call to
server.meerkat.getitems(). Printing out the list of items confirms this,
with what I can only describe as a somewhat-unexpected output:

{'description': "Senator Kennedy's new inaccessible web site. On writing for
the web. The Python path module. The art", 'title': 'In brief: Superbowl
Sunday'}
{'description': "Senator Kennedy's new inaccessible web site. On writing for
the web. The Python path module. The art", 'title': 'In brief: Superbowl
Sunday'}
{'description': "Senator Kennedy's new inaccessible web site. On writing for
the web. The Python path module. The art", 'title': 'In brief: Superbowl
Sunday'}
{'description': "Senator Kennedy's new inaccessible web site. On writing for
the web. The Python path module. The art", 'title': 'In brief: Superbowl
Sunday'}
{'description': "Senator Kennedy's new inaccessible web site. On writing for
the web. The Python path module. The art", 'title': 'In brief: Superbowl
Sunday'}
{'description': "Senator Kennedy's new inaccessible web site. On writing for
the web. The Python path module. The art", 'title': 'In brief: Superbowl
Sunday'}
{'description': "Senator Kennedy's new inaccessible web site. On writing for
the web. The Python path module. The art", 'title': 'In brief: Superbowl
Sunday'}
{'description': "Senator Kennedy's new inaccessible web site. On writing for
the web. The Python path module. The art", 'title': 'In brief: Superbowl
Sunday'}
{'description': "Senator Kennedy's new inaccessible web site. On writing for
the web. The Python path module. The art", 'title': 'In brief: Superbowl
Sunday'}
{'description': "Senator Kennedy's new inaccessible web site. On writing for
the web. The Python path module. The art", 'title': 'In brief: Superbowl
Sunday'}

About the only thing I find reassuring about this output is the fact that it
explains the KeyError, and that

    http://www.oreillynet.com/meerkat/

looks equally disoriented if you search for the string "python". What gives?

Can anyone tell me a) is this something I've done, or is it somebody else's
fault, and b) how the hell do I get back to the happy state where I can get
my Python news form my home page?

regards
--
Steve Holden                                  http://www.holdenweb.com/
Python Web Programming                 http://pydish.holdenweb.com/pwp/







More information about the Python-list mailing list