Fb2RSS

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

commit 257d27ee85a472f45d9d84a158cb890aaf02a109
parent b19f52e86b9286a24b04ef07735db8d0d21442f7
Author: Dominik Schmidt <das1993@hotmail.com>
Date:   Wed,  6 Jan 2016 20:41:06 +0100

Detect some cornercases.

Diffstat:
fbstream.d | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/fbstream.d b/fbstream.d @@ -99,6 +99,7 @@ class FBStream : DRSS!(Post){ headers[0][1]=url; XmlNode[] nodes=root.parseXPath(`//code`); + assert(nodes.length>0); generatePosts(nodes); } @@ -132,8 +133,12 @@ class FBStream : DRSS!(Post){ usercontent[0].removeChild(translatediv[0]); } SysTime t=SysTime(unixTimeToStdTime(to!ulong(match.getAttribute("data-time")))); - XmlNode[] href=match.parseXPath(`//a[@class="_5pcq"]`); - addEntry(Post(usercontent[0],t,href[0].getAttribute("href"))); + XmlNode[] href=match.parseXPath(`//a[@class="_5pcq"]`); + string hrefs; + if(href.length!=0){ + hrefs=href[0].getAttribute("href"); + } + addEntry(Post(usercontent[0],t,hrefs)); } /**