-
Notifications
You must be signed in to change notification settings - Fork 0
/
debug.js
34 lines (26 loc) · 1.02 KB
/
debug.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
const readline = require('readline');
const malScraper = require('mal-scraper')
const colors = require('colors');
const pjson = require('./package.json');
console.log('\x1Bc');
console.log(` Anime Music Debugger `.bold.cyan + pjson.version + `\n`);
console.log(` Created by @Soitora with \"Kylart/MalScraper\".`.grey);
console.log(` Made for use with https://animemusic.org/`.grey);
console.log(` Special thanks to @Kylart and @ParadoxOrigins!\n`.grey);
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
var recursiveAsyncReadLine = function() {
rl.question(' Input MyAnimeList ID: '.bold.red + 'https://myanimelist.net/anime/', (input) => {
const base = 'https://myanimelist.net';
const type = 'anime';
const url = `${base}/${type}/${input}`;
console.log(` Grabbing data...\n`.grey);
malScraper.getInfoFromURL(url)
.then((data) => console.log(data))
.catch((err) => console.log(colors.red(err)))
setTimeout(recursiveAsyncReadLine, 5000);
});
};
recursiveAsyncReadLine();