ffeedd 1.1.2

RSS 2.0 and Atom 1.0 feed writer


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

ffeedd

ffeedd (Fun feed D) is a RSS 2.0 and Atom 1.0 generator. The RSS and Atom output from the example program has been validated by the w3.org feed validator and passed the validations.

valid rss valid atom

How to use

Create a Feed class, fill in your data, add your FeedItems to Feed.items and run Feed.createAtomFeed() or Feed.createRSSFeed(), these functions will return a string with the generated feed. Here's a snippet from the example program

import ffeedd.feed;
import ffeedd.item;
import ffeedd.author;
import std.datetime;
...
// Feed name, link to the page, description of the feed
auto f = new Feed("ryhn.link", "https://ryhn.link/blog", "My very cool blog");
f.published = Clock.currTime().to!DateTime();
f.updated = Clock.currTime().to!DateTime() + 1.hours;
foreach (i; 0 .. 6)
{
	auto item = new FeedItem("Blog post " ~ i.to!string(),
		"https://ryhn.link/blog/" ~ i.to!string(), 
		"This is the " ~ i.to!string() ~ " post");
	item.published = Clock.currTime().to!DateTime();
	item.updated = Clock.currTime().to!DateTime() + (i+2).hours;
	item.authors ~= Author("Writer " ~ i.to!string(), "writer" ~ i.to!string()~ "@ryhn.link");
	f.items ~= item;
}
writeln(f.createAtomFeed());
writeln(f.createRSSFeed());
Authors:
  • Ryhon
Dependencies:
vibe-d:textfilter
Versions:
1.1.2 2023-May-31
1.1.1 2022-Oct-27
1.1.0 2021-Jul-25
1.0.0 2021-Jan-22
~main 2023-May-31
Show all 5 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 56 downloads total

Score:
0.5
Short URL:
ffeedd.dub.pm