Socket
Socket
Sign inDemoInstall

rt-sdk

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rt-sdk

[![npm version](https://badge.fury.io/js/rt-sdk.svg)](https://badge.fury.io/js/rt-sdk)


Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

rt-sdk

npm version

The rt-sdk is a simple little wrapper for Company X's APIs.

You can request things like:

  • series
  • episodes
  • livestreams
  • search results
  • products
  • and many more stuffz!

Get started!

  • Run yarn add rt-sdk in the root of your project. (This will add rt-sdk to your package.json)
const rt = require('rt-sdk');
  • Use one of the available methods listed below to start building!

Remember that all rt-sdk methods return a Promise()

Get all seasons of a specific show

rt.seasons() takes a show slug

rt.seasons('rt-podcast')
    .then(seasons => {
        for (let season of seasons) {
            console.log(season.attributes.title);
        }
    });

Get all episodes of a specific season

rt.season() takes a season slug

rt.season('always-open-2018')
    .then(episodes => {
        for (let episode of episodes) {
            console.log(episode.attributes.title);
            console.log(episode.attributes.description);
            console.log(episode.attributes.number);
        }
    });

Get a specific episode

rt.episode() takes an episode slug

rt.episode('lets-play-2012-16')
    .then(episode => {
        console.log(episode.attributes.show_title);
        console.log(episode.attributes.title); 
        console.log(episode.attributes.description);
        console.log(episode.included.images);
    });

Get all products of a specific show

rt.products() takes a show slug (and options). If there isn't a specific product collection associated with the show it will return generic products;

rt.products('cow-chop-gaming')
    .then(products => {
        for (let product of products) {
            console.log(product.title);
            console.log(JSON.stringify(product.body_html));
            console.log(product.image.src);
            console.log(product.url);
        }
    });

Get all upcoming (or in progress) livestreams

rt.livestream() only takes the optional options obj.

rt.livestreams()
    .then(episodes => {
        for (let episode of episodes) {
            console.log(episode.attributes.title); 
            console.log(episode.type); 
            console.log(episode.attributes.description);
            console.log(episode.included.images);
        }
    });

Get all series

rt.series() only takes the optional options obj.

rt.series()
    .then(episodes => {
        for (let episode of episodes) {
            console.log(episode.attributes.title); 
            console.log(episode.type); 
            console.log(episode.attributes.description);
            console.log(episode.included.images);
        }
    });

In progress.. More coming soon!

FAQs

Package last updated on 05 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc