xqwzts / feedparser

A Dart library for parsing RSS feeds
MIT License
17 stars 16 forks source link

Support for Atom and other feeds. #3

Closed axispx closed 3 years ago

axispx commented 6 years ago

Currently, only RSS 2.0 is supported.

axispx commented 6 years ago

I created atomparser using the same architecture as this project.

xqwzts commented 6 years ago

:+1:

If you're interested in submitting a PR to merge that functionality in I'd be happy to review.

axispx commented 6 years ago

I tried to add that functionality to this project but since this project's architecture is created for a single type of feed the code turned into spaghetti real soon. So I decided to create a different package for atom feeds.

If you can provide me proper direction on how to add the functionality such that the APIs are intuitive then I'd be happy to contribute to this project.

xqwzts commented 6 years ago

Yup it needs a refactor to allow for detecting feed type then delegating to the right adapter for that type to parse the feed, I've been meaning to get to it but unfortunately haven't had the time to do so - and the project that I initially built this for only uses RSS 2.0 feeds.

For this to work nicely we'd still want to return a common Feed object to the user - so they can extract the fields they expect without having to have any knowledge of the type of feed put in.

I'm curious if your atomparser ends up using the same models? In which case I should be able to whip up the code to detect the feed type and delegate to an rssparser/atomparser - which both have the same external API to consumers.

axispx commented 6 years ago

Atom feed items are completely different than RSS feed items so the possibility of returning a common Feed object is difficult.

If you have got some idea on how to do it with good API, a simple demo would be good.