-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdemo.ts
35 lines (28 loc) · 858 Bytes
/
demo.ts
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
// import { writeFile } from 'fs';
import { csfd } from './src';
// Parse movie
csfd.movie(10135).then((movie) => console.log(movie));
// csfd.search('matrix').then((search) => console.log(search));
// Parse creator
csfd.creator(2120).then((creator) => console.log(creator));
/**
* USER RATINGS
*/
// Save all pages in json file
// const userId = 912;
// csfd
// .userRatings(userId, {
// excludes: ['epizoda', 'pořad', 'série'],
// allPages: false,
// allPagesDelay: 2000
// })
// .then((ratings) => {
// console.log('Saved in file:', `./${userId}.json`);
// writeFile(`${userId}.json`, JSON.stringify(ratings), (err) => {
// if (err) return console.log(err);
// });
// });
// Only TV series
// csfd
// .userRatings('912-bart', { includesOnly: ['seriál'] })
// .then((ratings) => console.log(ratings));