-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
33 lines (28 loc) · 970 Bytes
/
index.js
File metadata and controls
33 lines (28 loc) · 970 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
26
27
28
29
30
31
32
33
const weeb = require('node-weeb');
weeb.anime('bleach').then(res => {
var data = JSON.parse(res).data[0]; // Parse JSON.
console.log(data.attributes.titles.en);
console.log(data.id);
console.log(data.attributes.synopsis);
});
weeb.manga('rosario vampire').then(res => {
var data = JSON.parse(res).data[0]; // Parse JSON.
console.log(data.attributes.titles.en);
console.log(data.id);
console.log(data.attributes.synopsis);
});
weeb.random('hug').then(res => {
console.log(res);
});
// Endpoint for Nekos.Life - https://github.com/Nekos-life/nekos-dot-life/blob/master/endpoints.json
// Or use the JSON file given.
const nekoLifeJSON = require('./nekoLife.json');
weeb.nekoLife(nekoLifeJSON.nsfw.trap, 'img').then(res => {
var data = JSON.parse(res).url; // Parse JSON.
console.log(data);
});
// without img.
weeb.nekoLife('fact').then(res => {
var data = JSON.parse(res).fact; // Parse JSON.
console.log(data);
});