Meerkat script suddenly fails: output format changed?

S

Steve Holden

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top