1.0.7 • Published 3 years ago
@seaneoo/rtapi v1.0.7
RTAPI
Lightweight API wrapper for Rooster Teeth. All data is obtained through public endpoints at svod-be.roosterteeth.com
.
Usage
// Will print the UUID and slug for every channel.
await getChannels().then((res) => {
res.forEach((r) => {
console.log(r.uuid, r.attributes.slug);
});
});
// Will print the UUID for 'achievement-hunter' to the console.
await getChannel('achievement-hunter').then((res) => {
console.log(res.uuid);
});
// Will return an error because 'adwawd' is not valid.
await getChannel('adwawd')
.then((res) => {
console.log("This won't be called!");
})
.catch(console.error);
// Will print the slug for every show.
await getShows().then((res) => {
res.forEach((r) => {
console.log(r.attributes.slug);
});
});
// Will print the slug for every show for 'achievement-hunter'.
await getChannelShows('achievement-hunter').then((res) => {
res.forEach((r) => {
console.log(r.attributes.slug);
});
});
// Will print the UUID for 'f-kface' to the console.
await getShow('f-kface').then((res) => {
console.log(res.uuid);
});
// Will return an error because 'adwawd' is not valid.
await getShow('adwawd')
.then((res) => {
console.log("This won't be called!");
})
.catch(console.error);
// Prints the title of every episode for the current day.
await getSchedule().then((res) => {
res.forEach((r) => {
console.log(r.attributes.title);
});
});
// Prints the title of every episode for April 6, 2021.
await getSchedule('2021-04-06T00:00:00-06:00').then((res) => {
res.forEach((r) => {
console.log(r.attributes.title);
});
});