1.0.7 • Published 3 years ago

@seaneoo/rtapi v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

RTAPI

npm npm bundle size npm

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);
  });
});
1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago