Skip to content

CodeMyst/ffeedd

 
 

Repository files navigation

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());

About

D RSS 2.0 and Atom 1.0 feed generator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • D 100.0%