Fb2RSS

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

commit f3bc186074f8d3bc0a05756c20736a96bb7d3775
parent 1414cb1721dd82cc338193f3a66d85a405432fe5
Author: Dominik Schmidt <das1993@hotmail.com>
Date:   Tue, 30 Jun 2015 22:22:54 +0200

Better title-generation added.

It now just takes the content of the first element in the userdata
(usually just a <p></p>), and cuts it off if its longer than 25 characters, by default.

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

diff --git a/Fb2RSS.d b/Fb2RSS.d @@ -171,9 +171,15 @@ struct Post{ XmlNode content; SysTime time; string href; + static ushort title_cutoff=25; @property string title(){ - return time.toString(); + string cont=content.getChildren()[0].getCData(); + if(cont.length>title_cutoff){ + cont=cont[0..title_cutoff]; + cont~="..."; + } + return cont; } @property string link(){