node-kickass

0.2.0 • Public • Published

node-kickass NPM version Build Status

NPM

Query for torrents at Kickass.to with Node.js.

Installation

Add node-kickass to your existing Node.js project.

npm install node-kickass --save

Usage

See examples for more usage details.

Built as a Fluent Interface. Also known as method chaining, as used in jQuery.

var Kickass = require('node-kickass');
 
var k = new Kickass()
.setQuery('Almost Human')   // Set search Query parameter 
.setPage(0)                 // Optional
.run(function(errors, data) {
  /*
  this  {context} => Current Context is set to be `k`.
  errors  {array} => An array of errors that occured.
  data    {array} => An array of items/articles that were read.
  */
  if (! errors.length > 0) {
    // No errors occured.
    console.log(data.length, "results");
    console.log(
      errors,     // Array of errors, will be empty array given there are no errors.
      data,       // Array of items/articles read from this `run`.
      this.items  // Array of all items/articles read that have been associated to `k`, which is the current context `this`.
      );
  } else {
    // One or more errors occured.
    console.log(errors, "errors");
  }
})
 

Functions

  • constructor
var k = new Kickass()
  • setQuery
k.setQuery("Search Name")
  • setPage
k.setPage(0)
  • setSort
k.setSort({
  field: "seeders",
  sorder: "desc"
});
  • run
k.run(function(errors, data) {
            //console.log(data);
            if (! errors.length > 0) {
                done();
                //console.log(data.length);
            } else {
                //console.log(errors);
            }
        });
  • wait (FIXME) Waits for all requests to be completed.
k.wait()

Disclaimer

There are obvious legal issues, with downloading copyrighted material you do not have a license for. We do not endorse such use cases and take no responsibility for the use people make of it.

Readme

Keywords

none

Package Sidebar

Install

npm i node-kickass

Weekly Downloads

1

Version

0.2.0

License

MIT

Last publish

Collaborators

  • glavin001