Releases: miniflycn/url-extract
Releases · miniflycn/url-extract
Release 0.2.1
You can set a function to handle the unfinished jobs now:
// Global Settings
var urlExtract = require('url-extract')({
unfinish: function (jobs) {
// when worker died, this function will callback
// you can push them to jobPool: jobs.push()
// or you can unshift them to jobPool: jobs.unshift()
}
});
Release 0.1.7
- You can set javascriptEnabled now:
// Global Settings
var urlExtract = require('url-extract')({
javascriptEnabled: true
});
// For one time
urlExtract.snapshot('http://www.baidu.com', {
javascriptEnabled: true,
callback: function (job) {
console.log(job);
}
})
Defines whether to execute the script in the page or not (defaults to false), so if it's true, PhantomJS will take a snapshot after all scripts.
Release 0.1.6
- Use timestamp replace Date instance
Release 0.1.4
- There is a new API for job being creatd.
Release 0.1.3
- enable disk cache
- add Copyright Notice
Release 0.1.2
fixed some bug about job option.
Release 0.1.1
- If someone try to initialize url-extract module more than one time, it will throw a error. For example:
var urlExtract = require('url-extract')(); // initialize first time
var urlExtract = require('url-extract')({
workerNum: 50
}); // initizlize second time, throw a error
// Because some options like 'workerNum' could not change after initialization,
// we prevent user do this and unknown error occurred.
var urlExtract = require('url-extract')();
// This does not throw an error, it's just get the url-extract module
Release 0.1.0
Module need to initialize now, use url-extract like this:
var urlExtract = require('url-extract')(option);
Release 0.0.9
- There are two config now, one is global config, another is job config.
- global config can be used by .opt
var urlExtract = require('../');
urlExtract.opt({
viewportSize: {
width: 800,
height: 400
},
clipRect: {
top: 0,
left: 0,
width: 800,
height: 400
}
});
urlExtract.snapshot('http://www.baidu.com', function (job) {
console.log('This is a snapshot example.');
console.log(job);
process.exit();
});
* job config can be used by .extract or .snapshot
```js
var urlExtract = require('../');
urlExtract.snapshot('http://www.baidu.com', {
viewportSize: {
width: 800,
height: 400
},
clipRect: {
top: 0,
left: 0,
width: 800,
height: 400
},
callback: function (job) {
console.log('This is a snapshot example.');
console.log(job);
process.exit();
}
});
Release 0.0.8
- add some global config, likes: viewportSize, clipRect, zoomFactor
- new method: .opt, using for setting config