1.0.6 • Published 8 years ago

t411-manager v1.0.6

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

T411 - Manager

Handles api calls to search torrents and other stuff...

Creation

var T411Manager = require('t411-manager'),
    t411client = new T411Manager({
        username : "username",
        password : "password"
        //or
        token : "token"
    });

Methods

The module uses q library for promises.

isConnected()

Return true if the user is connected

getToken()

Example :

t411client.getToken().then(function(token){
    console.log(token); //print your token
});

getCategorySize(cid)

Example :

t411client.getCategorySize(634).then(function(size){
    console.log(size); //print 26089
});

getCategoryTree()

Example :

t411client.getCategoryTree().then(function(tree){
    console.log(tree); //print category tree
});

getCategoryList()

Example :

t411client.getCategoryList().then(function(list){
    console.log(list); //print the list of all ids
});

getTorrents(searchParams)

Example :

var searchParams = {
    query: 'avatar',
    limit: 10
};
t411client.getTorrents(searchParams).then(function(torrents){
    torrents.forEach(function(torrent){
        console.log(torrent); //print each torrent (10) for the search query 'avatar'
    });
});

Another example :

var searchParams = {
    cid: 634,
    limit: 10,
    offset: 30
};
t411client.getTorrents(searchParams).then(function(torrents){
    torrents.forEach(function(torrent){
        console.log(torrent); //print each torrent (10) of the third page of documentaries
    });
});
1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago