Last updated:
0 purchases
rss generator
rss_generator #
A pure Dart plugin to generate an RSS file (Atom 2 format).
Validated by the official Feed Validation Service:
To parse an RSS, please have a look at existing solutions on Pub.dev.
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 #
Add res_generator: ^1.0.0 to your pubspec.yaml file.
Import import 'package:rss_generator/rss_generator.dart';
Create a RssBuilder by proving the multiple mandatory fields:
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',
),
);
copied to clipboard
You will then receive an XmlDocument and just have to call:
XmlDocument doc = builder.build();
// ⬇️ Your document
doc.toXmlString();
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.