DRSS

Ugly RSS interface for D.
git clone git://xatko.vsos.ethz.ch/DRSS.git
Log | Files | Refs | Submodules

commit 2ef75f9bb2de3c3b93bd7a46067f892ae0fa47e8
parent 53e0227a4363067f2b13b37671e0b63a9ebe15a6
Author: Dominik Schmidt <das1993@hotmail.com>
Date:   Sat,  1 Aug 2015 12:32:17 +0200

Count entries.

Diffstat:
drss/rss.d | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/drss/rss.d b/drss/rss.d @@ -38,6 +38,7 @@ abstract class DRSS(T=Entry){ abstract static bool date_is_reliable=true; immutable string url; abstract static uint max_entries=100; + uint entry_count=0; abstract void parse(string document); @@ -51,6 +52,7 @@ abstract class DRSS(T=Entry){ || (date_is_reliable && newent>entries.front) ){ entries.insertFront(newent); new_entries++; + entry_count++; return true; } else{ @@ -64,6 +66,10 @@ abstract class DRSS(T=Entry){ parse(cast(string)document); } + @property size_t length(){ + return entry_count; + } + public ubyte[] fetch(){ debug(RSS) writeln("Updateing"); auto h=HTTP();