RSS feed parser

Discussion in 'Python' started by Florian Lindner, Apr 2, 2007.

  1. Hello,
    I'm looking for python RSS feed parser library. Feedparser
    http://feedparser.org/ does not seem to maintained anymore.

    What alternatives are recommendable?

    Thanks,

    Florian
    Florian Lindner, Apr 2, 2007
    #1
    1. Advertising

  2. Florian Lindner

    Guest

    On Apr 2, 7:22 pm, Florian Lindner <> wrote:
    > Hello,
    > I'm looking for python RSS feed parser library. Feedparserhttp://feedparser.org/does not seem to maintained anymore.
    >
    > What alternatives are recommendable?
    >
    > Thanks,
    >
    > Florian


    Well, even if it's not maintained anymore (where does it say that?),
    it works fine and the API is great. Although of course I do realize
    that when a new version of RSS appears, feedparser won't be able to
    support it unless someone updates it. But RSS 2.0 appeared already in
    2002 and no new versions have come since. So I wouldn't worry too much
    about new RSSs popping up every month. Maybe the feedparser code
    hasn't been updated in a while because it's already perfect and
    there's nothing to add to it?-)
    , Apr 2, 2007
    #2
    1. Advertising

  3. wrote:

    > On Apr 2, 7:22 pm, Florian Lindner <> wrote:
    >> Hello,
    >> I'm looking for python RSS feed parser library.
    >> Feedparserhttp://feedparser.org/does not seem to maintained anymore.
    >>
    >> What alternatives are recommendable?
    >>
    >> Thanks,
    >>
    >> Florian

    >
    > Well, even if it's not maintained anymore (where does it say that?),
    > it works fine and the API is great. Although of course I do realize
    > that when a new version of RSS appears, feedparser won't be able to
    > support it unless someone updates it. But RSS 2.0 appeared already in
    > 2002 and no new versions have come since. So I wouldn't worry too much
    > about new RSSs popping up every month. Maybe the feedparser code
    > hasn't been updated in a while because it's already perfect and
    > there's nothing to add to it?-)


    No postings neither on the mailinglists nor in the forums are being
    answered.
    Somewhere he stated that he had turned to another hobby.

    Some of the question I have but found answered nowhere:

    I have a feedparser object that was created from a string. How can I trigger
    a update (from a new string) but the feedparser should treat the new string
    like the same feed (thus setting feed.updated etc.).

    - How can I trigger a update from a new file?
    - Does feedparser has the desired behavior?

    Regards,

    Florian
    Florian Lindner, Apr 2, 2007
    #3
  4. Florian Lindner

    Guest

    On Apr 2, 10:20 pm, Florian Lindner <> wrote:
    > Some of the question I have but found answered nowhere:
    >
    > I have a feedparser object that was created from a string. How can I trigger
    > a update (from a new string) but the feedparser should treat the new string
    > like the same feed (thus setting feed.updated etc.).


    Hmm. Do you mean that the feed object should stay the same? Like the
    difference between "a = [1,2,3]; a = [1,2,3]+[4]" and "a = [1,2,3];
    a.append(4)"? I glanced at the parse function in the source code and
    it looks like it's not directly possible. You could modify it so that
    the "result" dictionary is optionally given as an argument, so when
    updating you'd do: feedparser.parse(string, oldFeed). You'd also have
    to clear the oldFeed object before update.

    But you might also be able to solve the problem by using an additional
    layer of indirection. Instead of passing around the "feed" object,
    you'd pass around a proxy object like this:

    class Empty: pass
    proxy = Empty()
    proxy.feed = feedparser.parse(string)
    storeProxyForLaterUse(proxy)
    proxy.feed = feedparser.parse(string2)
    useStoredProxy() #this would use the updated feed through the proxy

    Then just use proxy.feed.updated everywhere instead of directly
    feed.updated. A smarter proxy would automatically translate
    proxy.updated into proxy.feed.updated so usage would stay as simple as
    without the proxy. Doing this is quite easy in Python (search for
    __getattr__ examples).
    , Apr 2, 2007
    #4
  5. wrote:

    > On Apr 2, 10:20 pm, Florian Lindner <> wrote:
    >> Some of the question I have but found answered nowhere:
    >>
    >> I have a feedparser object that was created from a string. How can I
    >> trigger a update (from a new string) but the feedparser should treat the
    >> new string like the same feed (thus setting feed.updated etc.).

    >
    > Hmm. Do you mean that the feed object should stay the same? Like the
    > difference between "a = [1,2,3]; a = [1,2,3]+[4]" and "a = [1,2,3];
    > a.append(4)"? I glanced at the parse function in the source code and
    > it looks like it's not directly possible. You could modify it so that
    > the "result" dictionary is optionally given as an argument, so when
    > updating you'd do: feedparser.parse(string, oldFeed). You'd also have
    > to clear the oldFeed object before update.
    >
    > But you might also be able to solve the problem by using an additional
    > layer of indirection. Instead of passing around the "feed" object,
    > you'd pass around a proxy object like this:
    >
    > class Empty: pass
    > proxy = Empty()
    > proxy.feed = feedparser.parse(string)
    > storeProxyForLaterUse(proxy)
    > proxy.feed = feedparser.parse(string2)
    > useStoredProxy() #this would use the updated feed through the proxy
    >
    > Then just use proxy.feed.updated everywhere instead of directly
    > feed.updated. A smarter proxy would automatically translate
    > proxy.updated into proxy.feed.updated so usage would stay as simple as
    > without the proxy. Doing this is quite easy in Python (search for
    > __getattr__ examples).


    I already use something like that (with __getattr__). The problem is that
    with this way there is still a new feed object created everytime a new
    string needs to be passed to.
    But since I want to use use the updated_parsed etc. function it's not
    possible that each time the feed is parsed a new object is created (the
    update times will always be the time of the last parsing).

    Any idea?

    Regards,

    Florian
    Florian Lindner, Apr 4, 2007
    #5
    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:
    5
    Views:
    754
    SpaceGirl
    Feb 25, 2005
  2. Motta
    Replies:
    1
    Views:
    520
    Andy Dingley
    Jun 9, 2004
  3. Scott Gordo
    Replies:
    5
    Views:
    694
  4. Lucas Nussbaum
    Replies:
    0
    Views:
    143
    Lucas Nussbaum
    Nov 15, 2005
  5. Jonathan Groll
    Replies:
    1
    Views:
    260
    Kouhei Sutou
    Jun 27, 2009
Loading...

Share This Page