Fb2RSS

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

commit b1b161d72b68bb5f65ad32f04373a0ba77beafb5
parent 93e6eac3fe74aea3ed304ed76bcff22bd8a0a5fe
Author: Dominik Schmidt <das1993@hotmail.com>
Date:   Sat, 15 Aug 2015 17:27:02 +0200

Override DRSS fetch() to allow file-reading.

Diffstat:
Fb2RSS.d | 15++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/Fb2RSS.d b/Fb2RSS.d @@ -68,7 +68,9 @@ class FBStream : DRSS!(Post){ ///The RSS-Header to append. string rss_header=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>`; - + + immutable string url; + /** * @param fetch_url Fetch the Data from this source */ @@ -77,6 +79,7 @@ class FBStream : DRSS!(Post){ h.url=fetch_url; h.setUserAgent(userAgent); date_reliability=DateReliable.YES; + url=fetch_url; super(h); } @@ -129,6 +132,16 @@ class FBStream : DRSS!(Post){ addEntry(Post(usercontent[0],t,href[0].getAttribute("href"))); } + public override bool fetch(){ + if(exists(url) && isFile(url)){ + buffer=cast(ubyte[])read(url); + return true; + } + else{ + return super.fetch(); + } + } + void writeRSS(File f){ import drss.render; XmlNode n=generateRSS(this,headers);