Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

data-sourcer

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

data-sourcer - npm Package Compare versions

Comparing version 1.9.1 to 1.10.0

48

abstracts/list-crawler.js

@@ -250,10 +250,48 @@ 'use strict';

navigateToList: function(page, list, options, done) {
if (list.link.url) {
this.navigateByHardCodedUrl(page, list.link.url, options, done);
} else if (list.link.selector) {
this.navigateByClicking(page, list.link.selector, done);
evaluateInPageContext: function(page, fn, args, done) {
if (!_.isFunction(fn)) {
return done(new Error('Invalid argument ("fn"): Function expected.'));
}
if (_.isFunction(args)) {
done = args;
args = null;
}
args = args || [];
try {
_.each(args, function(arg) {
if (JSON.parse(JSON.stringify(arg)) !== arg) {
throw new Error('Arguments passed to page context must be JSON serializable.');
}
});
} catch (error) {
return done(error);
}
page.waitForNavigation().then(function() {
return page.evaluate.apply(page, [fn].concat(args)).then(function() {
done();
});
}).catch(done);
},
navigateToList: function(page, list, options, done) {
var evaluateInPageContext = this.evaluateInPageContext.bind(this);
var navigateByHardCodedUrl = this.navigateByHardCodedUrl.bind(this);
var navigateByClicking = this.navigateByClicking.bind(this);
async.seq(
function(next) {
if (!list.link.evaluate) return next();
var fn = list.link.evaluate.fn;
var args = list.link.evaluate.args;
evaluateInPageContext(page, fn, args, next);
},
function(next) {
if (list.link.url) {
navigateByHardCodedUrl(page, list.link.url, options, next);
} else if (list.link.selector) {
navigateByClicking(page, list.link.selector, next);
}
}
)(done);
},
navigateByClicking: function(page, selector, done) {

@@ -260,0 +298,0 @@ var doNavigateByClicking = async.seq(

# Changelog
* v1.10.0:
* Added link.evaluate to list-crawler abstract
* Updated dependencies
* v1.9.1:

@@ -4,0 +7,0 @@ * Updated dependencies

13

package.json
{
"name": "data-sourcer",
"version": "1.9.1",
"version": "1.10.0",
"description": "Get (and filter) data from multiple different data sources quickly and efficiently.",

@@ -8,3 +8,2 @@ "main": "index.js",

"lint": "./node_modules/.bin/eslint --config .eslintrc.js *.js abstracts/*.js test/**/*.js",
"prepare": "npm run test",
"pretest": "npm run lint",

@@ -24,4 +23,4 @@ "test": "npm run test:unit",

"funding": {
"type" : "individual",
"url" : "https://degreesofzero.com/donate.html?project=data-sourcer"
"type": "individual",
"url": "https://degreesofzero.com/donate.html?project=data-sourcer"
},

@@ -35,5 +34,5 @@ "readmeFilename": "readme.md",

"debug": "4.1.1",
"puppeteer": "2.1.1",
"puppeteer": "3.0.2",
"request": "2.88.2",
"underscore": "1.9.2",
"underscore": "1.10.2",
"user-agents": "1.0.559",

@@ -46,4 +45,4 @@ "xml2js": "0.4.23"

"express": "4.17.1",
"mocha": "7.1.1"
"mocha": "7.1.2"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc