Meerkat script suddenly fails: output format changed?

Discussion in 'Python' started by Steve Holden, Jul 2, 2003.

  1. Steve Holden

    Steve Holden Guest

    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/
    Steve Holden, Jul 2, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    673
    Rosanne
    Oct 11, 2005
  2. Replies:
    1
    Views:
    602
    Mark Rae [MVP]
    Sep 5, 2007
  3. Mike Papper
    Replies:
    3
    Views:
    547
    Mike Papper
    Aug 25, 2010
  4. mxbrunet
    Replies:
    1
    Views:
    203
  5. dieter

    Re: Script suddenly stops

    dieter, May 30, 2014, in forum: Python
    Replies:
    0
    Views:
    49
    dieter
    May 30, 2014
Loading...

Share This Page