Fb2RSS

A Facebook to RSS conversion tool
git clone git://xatko.vsos.ethz.ch/Fb2RSS.git
Log | Files | Refs | Submodules

commit 6c89da2f5829ab29c05c57f289a79836032f6194
parent 712b216a525618b255dac50e1c2f3f6527cfe67d
Author: Dominik Schmidt <das1993@hotmail.com>
Date:   Wed,  1 Jul 2015 20:57:28 +0200

Add a generateRSS, which can be given a random range as a parameter.

This allows for neat things like str.generateRSS(std.algorithm.uniq(str)), or similar.

Diffstat:
Fb2RSS.d | 12++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)

diff --git a/Fb2RSS.d b/Fb2RSS.d @@ -272,6 +272,18 @@ class FBStream : RandomFiniteAssignable!(Post){ } return rss; } + + /** + * @overload generateRSS + * @param r Take the Posts from the range r, instead of #posts + */ + public XmlNode generateRSS(Range)(Range r) if(isInputRange!(Range)){ + XmlNode rss = getRSSRoot(); + foreach(Post p; r){ + rss.addChild(p.getEntry()); + } + return rss; + } /** * Writes a valid Atom-Feed xmlfile to the file specified