filebit-client by @michalbe
Automated client for file download helper - filebit.pl
Filebit-client allows to use filebit.pl in node.js environment.
Filebit-client has only two methods:
- login(login, password, callback)
- getLink(search-term, options, callback):
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
});
});
- 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)
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