Skip to content

Releases: miniflycn/url-extract

Release 0.2.1

07 Dec 16:46
Compare
Choose a tag to compare

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

09 Nov 02:57
Compare
Choose a tag to compare
  • 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

30 Oct 03:45
Compare
Choose a tag to compare
  • Use timestamp replace Date instance

Release 0.1.4

26 Sep 15:49
Compare
Choose a tag to compare
  • There is a new API for job being creatd.

Release 0.1.3

21 Sep 09:38
Compare
Choose a tag to compare
  • enable disk cache
  • add Copyright Notice

Release 0.1.2

18 Sep 14:30
Compare
Choose a tag to compare

fixed some bug about job option.

Release 0.1.1

16 Sep 14:24
Compare
Choose a tag to compare
  • 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

15 Sep 15:16
Compare
Choose a tag to compare

Module need to initialize now, use url-extract like this:

var urlExtract = require('url-extract')(option);

Release 0.0.9

15 Sep 12:23
Compare
Choose a tag to compare
  • 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

14 Sep 14:00
Compare
Choose a tag to compare
  • add some global config, likes: viewportSize, clipRect, zoomFactor
  • new method: .opt, using for setting config