Created
January 28, 2019 18:51
-
-
Save buley/f93a5e9fcf4a47a539a4e2b90c67b324 to your computer and use it in GitHub Desktop.
Readability - docs example fixed
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
var Readability = require('Readability'); | |
var JSDOM = require('jsdom').JSDOM; | |
var doc = new JSDOM("<body>Here's a bunch of text</body>", { | |
url: "https://www.example.com/the-page-i-got-the-source-from", | |
}); | |
let reader = new Readability(doc.window.document); | |
let article = reader.parse(); | |
console.log(article); |
Author
buley
commented
Jan 28, 2019
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment