0.0.14 • Published 4 years ago
realbooru v0.0.14
realbooru
An Node.js® Modules for interacting with the Realbooru.com API easily
Synchronous
const rBooru = require("realbooru");
let wrapper = new rBooru();
wrapper.getR(1, 1, "bondage").then((data) => {
console.log(data);
});
[
{
directory: 721,
hash: 'ba65269dc8b129ea1ada390bc7739ca2',
height: 2000,
id: 754726,
image: 'ba65269dc8b129ea1ada390bc7739ca2.jpeg',
change: 1613222030,
owner: 'jthec',
parent_id: 0,
rating: 'explicit',
sample: 1,
sample_height: 1275,
sample_width: 850,
score: null,
tags: 'bondage breasts cosplay handcuffs looking_at_the_viewer navel nipples nude pink_hair pubic_hair pussy solo',
width: 1333
}
]
Async
const rBooru = require("realbooru");
let wrapper = new rBooru();
async function yourstuff() {
await wrapper.getR(20, 1, "bondage score:>10").then((data) => {
// return with data
});
}
// do with your async stuff here
Random
const rBooru = require("realbooru");
let wrapper = new rBooru();
async function random() {
await wrapper.getR(20, 1, "bondage").then((data) => {
console.log(data[Math.floor(Math.random() * data.length)]);
});
}
random()
Docs:
.getR(limit, pid, tags)
limit: The limit of posts, max is 100
pid: The page number you want
tags: The tags you want to use
Tags scoring is work too eg:
.getR(limit, page, "bondage score:>10")
Further read more at: https://realbooru.com/index.php?page=help&topic=dapi