Skip to content

Commit 17b8dc0

Browse files
committed
feat(demo): add demo examples
1 parent fea2861 commit 17b8dc0

1 file changed

Lines changed: 20 additions & 16 deletions

File tree

demo.ts

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
1-
import { writeFile } from 'fs';
1+
// import { writeFile } from 'fs';
22
import { csfd } from './src';
33

44
// Parse movie
5-
// csfd.movie(535121).then((movie) => console.log(movie));
5+
csfd.movie(535121).then((movie) => console.log(movie));
66

7-
// Save data in file
8-
const userId = 912;
7+
/**
8+
* USER RATINGS
9+
*/
910

10-
csfd
11-
.userRatings(userId, {
12-
excludes: ['epizoda', 'TV pořad', 'série'],
13-
allPages: true,
14-
allPagesDelay: 2000
15-
})
16-
.then((ratings) => {
17-
console.log('Saved in file:', `./${userId}.json`);
18-
writeFile(`${userId}.json`, JSON.stringify(ratings), (err) => {
19-
if (err) return console.log(err);
20-
});
21-
});
11+
// // Save all pages in json file
12+
// const userId = 912;
13+
//
14+
// csfd
15+
// .userRatings(userId, {
16+
// excludes: ['epizoda', 'TV pořad', 'série'],
17+
// allPages: true,
18+
// allPagesDelay: 2000
19+
// })
20+
// .then((ratings) => {
21+
// console.log('Saved in file:', `./${userId}.json`);
22+
// writeFile(`${userId}.json`, JSON.stringify(ratings), (err) => {
23+
// if (err) return console.log(err);
24+
// });
25+
// });
2226

2327
// // Only TV series
2428
// csfd

0 commit comments

Comments
 (0)