-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
41 lines (32 loc) · 1.01 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const Board = require('./src/api/board/board');
const Pinner = require('./src/api/pinner/pinner');
const Auth = require('./src/api/auth/auth');
const PinCore = require('./src/api/core/pinCore');
class PinBot extends PinCore {
constructor(options = {}) {
super(options);
this._pagination_time = 800; //0.8 second
}
async auth() {
var auth = new Auth(this._config);
await auth.init();
this._csrfToken = auth.csrfToken;
this._cookieJar = auth.cookieJar;
this._isLoggedIn = true;
}
board() {
let board = new Board(this._config);
board.csrfToken = this._csrfToken;
board.cookieJar = this._cookieJar;
board.isLoggedIn = true;
return board;
}
pinner() {
let pinner = new Pinner(this._config);
pinner.csrfToken = this._csrfToken;
pinner.cookieJar = this._cookieJar;
pinner.isLoggedIn = true;
return pinner;
}
}
module.exports = PinBot;