RSS feed parser

  • Thread starter Florian Lindner
  • Start date
I

irstas

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?-)
 
F

Florian Lindner

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
 
I

irstas

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).
 
F

Florian Lindner

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
 

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
474,001
Messages
2,570,250
Members
46,848
Latest member
Graciela Mitchell

Latest Threads

Top