node-readability
Advanced tools
Comparing version 0.0.5 to 0.0.6
var readability = require('../src/readability') | ||
, fs = require('fs') | ||
@@ -4,0 +3,0 @@ // uncoment the following line to print the debug info to console. |
{ | ||
"name": "node-readability", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"author": "Zihua Li", | ||
@@ -11,2 +11,5 @@ "description": "Turning any web page into a clean view.", | ||
}, | ||
"scripts": { | ||
"test": "./node_modules/mocha/bin/mocha" | ||
}, | ||
"main": "./src/readability", | ||
@@ -23,6 +26,12 @@ "licenses": [ | ||
}, | ||
"engines": ["node >=0.5.10"], | ||
"engines": [ | ||
"node >=0.5.10" | ||
], | ||
"keywords": [ | ||
"readability" | ||
] | ||
], | ||
"devDependencies": { | ||
"mocha": "~1.8.2", | ||
"should": "~1.2.2" | ||
} | ||
} |
@@ -9,6 +9,2 @@ # node-readability | ||
## Requirements | ||
* [jsdom](https://github.com/tmpvar/jsdom) | ||
* [fetch](https://github.com/andris9/fetch) | ||
## Usage | ||
@@ -49,3 +45,3 @@ | ||
* **cookieJar** for sharing cookies between requests, see below | ||
* **outputEncoding** | ||
* **outputEncoding** | ||
* **disableDecoding** set to true to disable automatic charset decoding to utf-8 | ||
@@ -52,0 +48,0 @@ * **overrideCharset** set input encoding |
@@ -431,3 +431,3 @@ // All of the regular expressions in use within readability. | ||
for (var ei = 0, il = embeds.length; ei < il; ei++) { | ||
if (embeds[ei].src.search(regexps.videoRe) == -1) { | ||
if (embeds[ei].src && embeds[ei].src.search(regexps.videoRe) == -1) { | ||
embedCount++; | ||
@@ -434,0 +434,0 @@ } |
@@ -1,4 +0,4 @@ | ||
var jsdom = require('jsdom'), | ||
fetchUrl = require('fetch').fetchUrl, | ||
helpers = require('./helpers'); | ||
var jsdom = require('jsdom'); | ||
var fetchUrl = require('fetch').fetchUrl; | ||
var helpers = require('./helpers'); | ||
@@ -11,3 +11,3 @@ exports.debug = function (debug) { | ||
function Readablity(document) { | ||
function Readability(document) { | ||
this._document = document; | ||
@@ -27,3 +27,3 @@ this.iframeLoads = 0; | ||
Readablity.prototype.getContent = function () { | ||
Readability.prototype.getContent = function () { | ||
if (typeof this.cache['article-content'] !== 'undefined') { | ||
@@ -45,3 +45,3 @@ return this.cache['article-content']; | ||
Readablity.prototype.getTitle = function () { | ||
Readability.prototype.getTitle = function () { | ||
if (typeof this.cache['article-title'] !== 'undefined') { | ||
@@ -71,7 +71,7 @@ return this.cache['article-title']; | ||
Readablity.prototype.getDocument = function () { | ||
Readability.prototype.getDocument = function () { | ||
return this._document; | ||
}; | ||
Readablity.prototype.getHTML = function () { | ||
Readability.prototype.getHTML = function () { | ||
return this._document.getElementsByTagName('html')[0].innerHTML; | ||
@@ -101,7 +101,4 @@ }; | ||
done: function (errors, window) { | ||
try { | ||
callback(null, new Readablity(window.document, options)); | ||
} catch (e) { | ||
callback(e); | ||
} | ||
if (errors) return callback(errors); | ||
callback(null, new Readability(window.document, options)); | ||
} | ||
@@ -108,0 +105,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
26248
8
609
0
0
2
77