This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// fancily gets the text content of an html page | |
function getArticleText() { | |
function textNodesUnder(node){ | |
var all = []; | |
for (node=node.firstChild;node;node=node.nextSibling){ | |
if (node.nodeType==3) all.push(node); | |
else all = all.concat(textNodesUnder(node)); | |
} | |
return all; |