crawler-html-analysis
Advanced tools
Comparing version 1.0.8 to 1.0.9
109
built/app.js
@@ -78,14 +78,2 @@ "use strict"; | ||
case 0: | ||
if (ctx.queueItem) { | ||
_context.next = 4; | ||
break; | ||
} | ||
_context.next = 3; | ||
return next(); | ||
case 3: | ||
return _context.abrupt("return", _context.sent); | ||
case 4: | ||
rules = getRules(ctx.config, ctx.queueItem); | ||
@@ -95,3 +83,3 @@ urls = []; | ||
if (rules.length) { | ||
_context.next = 10; | ||
_context.next = 6; | ||
break; | ||
@@ -101,12 +89,12 @@ } | ||
ctx.status.htmlAnalysis = false; | ||
_context.next = 67; | ||
_context.next = 62; | ||
break; | ||
case 10: | ||
case 6: | ||
ctx.queueItem.analysisResult = []; | ||
// 解析html页面成 文本,用于分词分析 | ||
_context.next = 13; | ||
_context.next = 9; | ||
return _deal2.default.doDeal(ctx.queueItem, defaultRule); | ||
case 13: | ||
case 9: | ||
ctx.queueItem.responseBodyText = _context.sent.result.text; | ||
@@ -118,8 +106,8 @@ | ||
_iteratorError = undefined; | ||
_context.prev = 17; | ||
_context.prev = 13; | ||
_iterator = (0, _getIterator3.default)(rules); | ||
case 19: | ||
case 15: | ||
if (_iteratorNormalCompletion = (_step = _iterator.next()).done) { | ||
_context.next = 30; | ||
_context.next = 26; | ||
break; | ||
@@ -134,6 +122,6 @@ } | ||
_context.t0 = ctx.queueItem.analysisResult; | ||
_context.next = 25; | ||
_context.next = 21; | ||
return _deal2.default.doDeal(ctx.queueItem, rule); | ||
case 25: | ||
case 21: | ||
_context.t1 = _context.sent; | ||
@@ -143,20 +131,20 @@ | ||
case 27: | ||
case 23: | ||
_iteratorNormalCompletion = true; | ||
_context.next = 19; | ||
_context.next = 15; | ||
break; | ||
case 30: | ||
_context.next = 36; | ||
case 26: | ||
_context.next = 32; | ||
break; | ||
case 32: | ||
_context.prev = 32; | ||
_context.t2 = _context["catch"](17); | ||
case 28: | ||
_context.prev = 28; | ||
_context.t2 = _context["catch"](13); | ||
_didIteratorError = true; | ||
_iteratorError = _context.t2; | ||
case 36: | ||
_context.prev = 36; | ||
_context.prev = 37; | ||
case 32: | ||
_context.prev = 32; | ||
_context.prev = 33; | ||
@@ -167,7 +155,7 @@ if (!_iteratorNormalCompletion && _iterator.return) { | ||
case 39: | ||
_context.prev = 39; | ||
case 35: | ||
_context.prev = 35; | ||
if (!_didIteratorError) { | ||
_context.next = 42; | ||
_context.next = 38; | ||
break; | ||
@@ -178,10 +166,9 @@ } | ||
case 42: | ||
return _context.finish(39); | ||
case 38: | ||
return _context.finish(35); | ||
case 43: | ||
return _context.finish(36); | ||
case 39: | ||
return _context.finish(32); | ||
case 44: | ||
; | ||
case 40: | ||
@@ -192,3 +179,3 @@ // 找出分析中的url数据 | ||
_iteratorError2 = undefined; | ||
_context.prev = 48; | ||
_context.prev = 43; | ||
@@ -210,14 +197,14 @@ _loop = function _loop() { | ||
} | ||
_context.next = 57; | ||
_context.next = 52; | ||
break; | ||
case 53: | ||
_context.prev = 53; | ||
_context.t3 = _context["catch"](48); | ||
case 48: | ||
_context.prev = 48; | ||
_context.t3 = _context["catch"](43); | ||
_didIteratorError2 = true; | ||
_iteratorError2 = _context.t3; | ||
case 57: | ||
_context.prev = 57; | ||
_context.prev = 58; | ||
case 52: | ||
_context.prev = 52; | ||
_context.prev = 53; | ||
@@ -228,7 +215,7 @@ if (!_iteratorNormalCompletion2 && _iterator2.return) { | ||
case 60: | ||
_context.prev = 60; | ||
case 55: | ||
_context.prev = 55; | ||
if (!_didIteratorError2) { | ||
_context.next = 63; | ||
_context.next = 58; | ||
break; | ||
@@ -239,17 +226,17 @@ } | ||
case 63: | ||
return _context.finish(60); | ||
case 58: | ||
return _context.finish(55); | ||
case 64: | ||
return _context.finish(57); | ||
case 59: | ||
return _context.finish(52); | ||
case 65: | ||
case 60: | ||
ctx.queueItem.analysisResultUrls = urls || []; | ||
ctx.status.htmlAnalysis = true; | ||
case 67: | ||
_context.next = 69; | ||
case 62: | ||
_context.next = 64; | ||
return next(); | ||
case 69: | ||
case 64: | ||
case "end": | ||
@@ -259,3 +246,3 @@ return _context.stop(); | ||
} | ||
}, _callee, undefined, [[17, 32, 36, 44], [37,, 39, 43], [48, 53, 57, 65], [58,, 60, 64]]); | ||
}, _callee, undefined, [[13, 28, 32, 40], [33,, 35, 39], [43, 48, 52, 60], [53,, 55, 59]]); | ||
})); | ||
@@ -262,0 +249,0 @@ |
@@ -1,1 +0,1 @@ | ||
{"name":"crawler-html-analysis","version":"1.0.8","description":"","main":"built/app.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","built":"babel -s -d built/ src/ "},"repository":{"type":"git","url":"https://github.com/nick121212/crawler-html-analysis.git"},"author":"NICK","license":"MIT","dependencies":{"boom":"^4.2.0","jsdom":"^9.8.3","json-path-processor":"^0.2.3","json-pointer":"^0.6.0","lodash":"^4.17.2","moment":"^2.17.1","qs":"^6.3.0"},"devDependencies":{"babel-core":"^6.0.20","babel-plugin-syntax-async-functions":"^6.8.0","babel-plugin-transform-async-to-generator":"^6.8.0","babel-plugin-transform-runtime":"^6.12.0","babel-polyfill":"^6.0.16","babel-preset-es2015":"^6.13.1","babel-preset-es2015-node5":"^1.1.2","babel-preset-stage-0":"^6.5.0","babel-preset-stage-3":"^6.17.0","babel-register":"^6.4.3","babel-runtime":"^6.11.6","eslint-plugin-promise":"^3.4.0","eventsource-polyfill":"^0.9.6"}} | ||
{"name":"crawler-html-analysis","version":"1.0.9","description":"","main":"built/app.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","built":"babel -s -d built/ src/ "},"repository":{"type":"git","url":"https://github.com/nick121212/crawler-html-analysis.git"},"author":"NICK","license":"MIT","dependencies":{"boom":"^4.2.0","jsdom":"^9.8.3","json-path-processor":"^0.2.3","json-pointer":"^0.6.0","lodash":"^4.17.2","moment":"^2.17.1","qs":"^6.3.0"},"devDependencies":{"babel-core":"^6.0.20","babel-plugin-syntax-async-functions":"^6.8.0","babel-plugin-transform-async-to-generator":"^6.8.0","babel-plugin-transform-runtime":"^6.12.0","babel-polyfill":"^6.0.16","babel-preset-es2015":"^6.13.1","babel-preset-es2015-node5":"^1.1.2","babel-preset-stage-0":"^6.5.0","babel-preset-stage-3":"^6.17.0","babel-register":"^6.4.3","babel-runtime":"^6.11.6","eslint-plugin-promise":"^3.4.0","eventsource-polyfill":"^0.9.6"}} |
@@ -40,6 +40,2 @@ import _ from "lodash"; | ||
return async(ctx, next) => { | ||
if (!ctx.queueItem) { | ||
return await next(); | ||
} | ||
let rules = getRules(ctx.config, ctx.queueItem); | ||
@@ -61,3 +57,2 @@ let urls = []; | ||
} | ||
; | ||
@@ -64,0 +59,0 @@ // 找出分析中的url数据 |
Sorry, the diff of this file is not supported yet
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
269992
5245