Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/g123k/dart_rss_generator
RSS (Atom 2.0) generator in Dart
https://github.com/g123k/dart_rss_generator
Last synced: about 1 month ago
JSON representation
RSS (Atom 2.0) generator in Dart
- Host: GitHub
- URL: https://github.com/g123k/dart_rss_generator
- Owner: g123k
- License: apache-2.0
- Created: 2022-05-01T12:31:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-05T18:17:21.000Z (7 months ago)
- Last Synced: 2024-04-20T15:18:49.745Z (7 months ago)
- Language: Dart
- Homepage: https://pub.dev/packages/rss_generator
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# rss_generator
[![Pub](https://img.shields.io/pub/v/rss_generator.svg)](https://pub.dartlang.org/packages/rss_generator)
A pure Dart plugin to generate an RSS file (Atom 2 format).
Validated by the official Feed Validation Service: ![](https://validator.w3.org/feed/images/valid-rss-rogers.png)
To parse an RSS, please have a look at [existing solutions on Pub.dev](https://pub.dev/packages/dart_rss).
## Mandatory fields
In an Atom/RSS fields, here are all the mandatory fields:
- Channel name
- Channel description
- Channel link (= link to a website)
- Atom link (= link to the RSS)
- For each item:
- A title
- A description
- A link## Installation
1. Add `res_generator: ^1.0.0` to your `pubspec.yaml` file.
2. Import `import 'package:rss_generator/rss_generator.dart';`
3. Create a `RssBuilder` by proving the multiple mandatory fields:```dart
RssBuilder builder = RssBuilder(
channelName: 'My WebSite',
channelDescription: 'My super website',
channelLink: 'https://flutter-digest.com/',
channelAtomLink: 'https://rss.flutter-digest.com/',
)
.copyright('Copyright 2022')
.pubDate(DateTime.now())
.skipDays({RssSkipDay.friday})
.skipHours({RssSkipHour.hour0})
.ttl(60)
.addItem(
RssItemBuilder(
title: 'Article 1',
description: 'Article 1 description',
link: 'https://archives.flutter-digest.com/latest',
),
);
```4. You will then receive an `XmlDocument` and just have to call:
```dart
XmlDocument doc = builder.build();// ⬇️ Your document
doc.toXmlString();
```