-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
25 lines (23 loc) · 734 Bytes
/
index.js
File metadata and controls
25 lines (23 loc) · 734 Bytes
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
const malApi = require('./src/api');
const fs = require('fs');
var count = 0;
async function main(){
var results = await malApi.queryTopManga(10);
fs.appendFile("files.json", JSON.stringify(results), () => {});
//var results = JSON.parse(fs.readFileSync('files.json', 'utf8'));
//fs.appendFile("data.json", "[", () => {});
//for(var i = 3616; i < results.length; i++){
// console.log(count++);
// try{
// var x = await malApi.queryEntry(results[i]);
// fs.appendFile("data.json", `${JSON.stringify(x)},`, () => {});
// }catch(e){
// console.log(e);
// fs.appendFile("error.json", `${results[i]}\n`, () => {});
// }finally{
// malApi.sleep(5000);
// }
//}
//fs.appendFile("data.json", "]", () => {});
}
main();