@p.aleks/myshows-api
TypeScript icon, indicating that this package has built-in type declarations

0.0.29 • Public • Published

@p.aleks/myshows-api

Forked from @asznee7/myshows-api

GitHub license

Overview

Simple API wrapper for logging into and interacting with MyShows website. Rewritten to Typescript.

Supported versions

  • MyShows.me API v2.0 - based on JSON-RPC 2.0 with OAuth 2.0 as authorization. In order to use this module you need to obtain OAuth AppID. If you don't have one you can request in here api@myshows.me.

Getting started

To install run

$ yarn add @p.aleks/myshows-api
// or
$ npm install @p.aleks/myshows-api

Simple example of using generic method:

import MyShows from '@p.aleks/myshows-api';

const credentials = {
  client_id: 'your_client_id',
  client_secret: 'your_client_secret',
  username: 'your_username',
  password: 'your_password',
}

async function example() {
  const myshows = new MyShows(credentials)

  const user = await myshows.generic('profile.Get', {
    login: 'Aikenov',
  }) // profile.Get API method does not require logging in

  await myshows.login() // after logging in you can use API methods that require authorization

  const list = await myshows.generic('lists.Shows', {
    list: 'favorites',
  }) // lists.Shows API method does require logging in

  console.log(user)
  console.log(list)
}

example()

API Documentation

See the MyShows.me API page to start exploring documentation.

Readme

Keywords

none

Package Sidebar

Install

npm i @p.aleks/myshows-api

Weekly Downloads

5

Version

0.0.29

License

MIT

Unpacked Size

64.1 kB

Total Files

15

Last publish

Collaborators

  • p.aleks