pmp-scraper
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -33,2 +33,6 @@ 'use strict'; | ||
var _events = require('events'); | ||
var _events2 = _interopRequireDefault(_events); | ||
var _modulesMain = require('./modules/main'); | ||
@@ -42,4 +46,2 @@ | ||
var EventEmitter = require('events'); | ||
var PmpScraper = (function (_EventEmitter) { | ||
@@ -154,9 +156,11 @@ _inherits(PmpScraper, _EventEmitter); | ||
_this.emit('info', 'report-' + val.pageNumber, { | ||
report: results.generateReport.report | ||
_this.emit('report', { | ||
id: val.pageNumber, | ||
data: results.generateReport.report | ||
}); | ||
if (val.pageNumber % _this.options.statsInterval == 0) { | ||
_this.emit('info', 'stats-' + val.pageNumber, { | ||
stats: _this.stats.getStats(true) | ||
_this.emit('stats', { | ||
id: val.pageNumber, | ||
data: _this.stats.getStats(true) | ||
}); | ||
@@ -186,3 +190,3 @@ } | ||
_this2.emit('info', 'scrapeSource.start', { | ||
_this2.emit('scrape-start', { | ||
source: val.source.id, | ||
@@ -217,6 +221,6 @@ pageNumber: _this2.pageNumber, | ||
_this2.emit('error', 'async.forever', err); | ||
_this2.emit('scrape-error', err); | ||
if (_lodash2['default'].isString(thresholdMessage)) { | ||
_this2.emit('info', 'scrapeSource.end', { | ||
_this2.emit('scrape-end', { | ||
source: val.source.id, | ||
@@ -239,3 +243,3 @@ pageNumber: _this2.pageNumber, | ||
this.emit('warn', 'reindexImages', 'started'); | ||
this.emit('reindex-start'); | ||
@@ -246,7 +250,7 @@ _modulesMain2['default'].reindexImages({ | ||
if (err) { | ||
_this3.emit('error', 'reindexImages', err); | ||
_this3.emit('reindex-error', err); | ||
return; | ||
} | ||
_this3.emit('info', 'reindexImages', res); | ||
_this3.emit('reindex-end', res); | ||
}); | ||
@@ -369,5 +373,5 @@ } | ||
return PmpScraper; | ||
})(EventEmitter); | ||
})(_events2['default']); | ||
exports['default'] = PmpScraper; | ||
module.exports = exports['default']; |
{ | ||
"name": "pmp-scraper", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "PicMePlease Scraper API", | ||
@@ -5,0 +5,0 @@ "homepage": "", |
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
899
36938