Compare commits

...

1 Commits

Author SHA1 Message Date
Nicolas Perriault 61dc9b64b4 Fixes #220 - Use article content when a single one exists in the page. 9 years ago

@ -622,6 +622,14 @@ Readability.prototype = {
return null;
}
var articleTags = this._doc.getElementsByTagName("article");
if (articleTags.length === 1) {
this._forEachNode(page.children, function(pageChild) {
page.removeChild(pageChild);
});
page.appendChild(articleTags[0]);
}
var pageCacheHtml = page.innerHTML;
// Check if any "dir" is set on the toplevel document element
@ -926,7 +934,7 @@ Readability.prototype = {
} else {
return articleContent;
}
}
} // end while(true)
},
/**

@ -0,0 +1,7 @@
{
"title": "Asia-pacific - Third blogger hacked to death in Bangladesh",
"byline": "Text by \n NEWS WIRES",
"dir": "ltr",
"excerpt": "Ananta Bijoy Das, a 33-year-old blogger who advocated secularism, was attacked by four assailants in the northeastern Sylhet district on Tuesday morning as he headed to work at a local bank, police said.",
"readerable": true
}

@ -0,0 +1,14 @@
<div id="readability-page-1" class="page">
<div class="bd">
<p>Ananta Bijoy Das, a 33-year-old blogger who advocated secularism, was attacked by four assailants in the northeastern Sylhet district on Tuesday morning as he headed to work at a local bank, police said.</p>
<p>After the attackers fled, Das was rushed to hospital but declared dead on arrival, police and medics said.</p>
<p>Das wrote for Mukto Mona, or free mind, a website propagating rationalism and opposing fundamentalism that was founded by US-based blogger Avijit Roy.</p>
<p>Roy himself was hacked to death in February while returning with his wife from a book fair in the capital Dhaka.</p>
<p>His widow, Rafida Bonya Ahmed, suffered head injuries and lost a finger. In an interview with Reuters in the United States published on Monday, Ahmed called her husbands killing “a global act of terrorism”.</p>
<p>Religious militants have targeted secularist writers in Bangladesh in recent years, while the government has tried to crack down on hardline Islamist groups seeking to make the South Asian nation of 160 million a sharia-based state.</p>
<p>On March 30, Washiqur Rahman, another secular blogger who aired his outrage over Roys death on social media, was killed in similar fashion on a busy street in the capital, Dhaka.</p>
<p>Their deaths followed the similar killing in 2013 of Ahmed Rajib Haider, who backed calls to impose the death penalty on Islamist leaders accused of atrocities in Bangladeshs 1971 war of independence.</p>
<p><em>(FRANCE 24 with AFP, REUTERS)</em></p>
<p class="modification">Date created : 2015-05-12</p>
</div>
</div>

File diff suppressed because it is too large Load Diff

@ -1,9 +1,7 @@
<div id="readability-page-1" class="page">
<div>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
<p>
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</p>
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div>

@ -11,9 +11,9 @@
<br>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.</p>
<br><br><p>Ut enim ad minim veniam,
<br><br>Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.</p><br>
consequat.<br>
<p>Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

@ -28,8 +28,4 @@
<p>“Now its hard to see what could persuade the Palestinians” to hold up on their ICC plans, Indyk said. “That has nothing to do with negotiations, but if both sides cant be persuaded to back down, then they will be on a trajectory that could lead to the collapse of the Palestinian Authority because it cant pay wages anymore.</p>
<p>“That could be an issue forced onto the agenda about the same time as a potential nuclear deal.”</p>
</article>
<div class="post-body-sig-line">
<a href="http://www.washingtonpost.com/people/steven-mufson"><img class="post-body-headshot-left" src="http://img.washingtonpost.com/wp-apps/imrs.php?src=http://www.washingtonpost.com/blogs/wonkblog/files/2014/07/mufson_steve.jpg&amp;h=180&amp;w=180"></a>
<p class="post-body-bio has-photo">Steven Mufson covers the White House. Since joining The Post, he has covered economics, China, foreign policy and energy.</p>
</div>
</div>
Loading…
Cancel
Save