Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kascote/universal_feed
Universal parser for RSS and Atom feeds with support for some extensions (dc, dcterms, media, itunes, georss, syndication, content)
https://github.com/kascote/universal_feed
atom atom-parser dart feed feed-parser rss rss-parser rss-reader
Last synced: 3 days ago
JSON representation
Universal parser for RSS and Atom feeds with support for some extensions (dc, dcterms, media, itunes, georss, syndication, content)
- Host: GitHub
- URL: https://github.com/kascote/universal_feed
- Owner: kascote
- License: mit
- Created: 2022-10-22T04:35:23.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-29T21:49:17.000Z (6 months ago)
- Last Synced: 2024-06-30T00:48:27.183Z (6 months ago)
- Topics: atom, atom-parser, dart, feed, feed-parser, rss, rss-parser, rss-reader
- Language: Dart
- Homepage:
- Size: 331 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Universal Feed Parser
Universal Feed is a feed parser that supports RSS and Atom feeds. The library unifies the parsing of different feeds in a common entity, simplifying consumption.
Supported feeds versions
* RSS 0.90
* Netscape RSS 0.91
* Userland RSS 0.91
* RSS 0.92
* RSS 0.93
* RSS 0.94
* RSS 1.0
* RSS 2.0
* Atom 0.3
* Atom 1.0Supported feeds extensions
* Dublin Core
* Dublin Core Terms
* Geo RSS
* Media RSS
* Syndication
* Itunes## Overview
This library makes no assumptions about the data parsed and tries to be quite liberal about the feed's content.
For example, `timestamps`, the field's value is read, but there is no attempt to parse them when the feed is processed. The TimeStamp object used has methods to help with the parsing.
To understand the mapping of RSS and Atom to Universal Feed can check [this file](./field_mapping.md).## Getting started
Here is a simple example to get started:
```dart
final file = File(filepath);
final content = file.readAsStringSync();final uf = UniversalFeed.parseFromString(content);
print(uf.title);
print(uf.description);
print(uf.meta.kind); // rss or atom
print(uf.meta.extensions); // extensions declared on the header
print(uf.meta.version); // feed version
```## Developing
The library is entirely new and was not battle-tested yet. I'm using a corpus of 400~ feeds, and it goes through
it without trouble. But there are still some parts that I want to review and maybe refactor.