Skip to content

Hodutu/filebit-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

filebit-client by @michalbe

Automated client for file download helper - filebit.pl

What?

Filebit-client allows to use filebit.pl in node.js environment.

API:

Filebit-client has only two methods:

  • login(login, password, callback)
  • getLink(search-term, options, callback):

How to use:

npm install filebit-client

then:

var fbc = require('filebit-client');

// Log-in first
fbc.login('my-login', 'my-password', function(error, loggedIn){
  if (error) {
    // we could not logged in
    console.log(error);
    return;
  }

  // We are logged in, so let's download some file!
  fbc.getLink('http://some-very-expensive-hosting-site.com/file.mkv', function(error, link){
    if (error) {
      // we could not get proper link
      console.log(error);
      return;
    }

    // We have nice link to download!
    console.log(link); // http://blabla.filebit.pl/file.mkv
  });
});

To Do

  • Support of multiple files in one request
  • Fix timestamps in tests (sometimes tests fail because the date used in Nock to mock the server response is different than the one used to send the request)

Testing

To contribute to the project:

#clone the repo
$ git clone [email protected]:michalbe/filebit-client.git
$ cd filebit-client

#install all the dependencies
$ npm install

#to run jshint:
$ npm run lint

#to run tests
$ npm test

Tests & linter are hooked to commit (using precommit-hook), it's not possible tocommit if linter is not passing or there are failing tests. To commit anyway:

$ git commit -n

About

Automated client for file download helper - filebit.pl

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published