Movies Anywhere Connector

reshuffle-moviesanywhere-connector

Code | npm | Code sample

npm install reshuffle-moviesanywhere-connector

Reshuffle Movies Anywhere Connector

This package contains a Resshufle connector to Movies Anywhere, providing access to movie data per the Movies Anywhere API.

The following actions return title information in the TitleData structure, as defined by the Movies Anywhere API. If the connector is configured with an API token, the returned data will include trailer information.

The following example create and API endpoint for retrieving movie data using it EDIR ID. You can try 10.5240/DF48-AB62-4486-C185-9E1B-4 or find EIDR IDs using the Reshuffle EIDR Connector:

const { Reshuffle, HttpConnector } = require('reshuffle')
const { MoviesAnywhereConnector } = require('reshuffle-moviesanywhere-connector')

const app = new Reshuffle()
const ma = new MoviesAnywhereConnector(app)
const http = new HttpConnector(app)

http.on({ method: 'GET', path: '/' }, async (event) => {
  const eidr = event.req.query.eidr
  if (!/^10\.5240\/([0-9A-F]{4}-){5}[0-9A-Z]$/.test(eidr)) {
    return event.res.status(400).send(`Invalid EIDR ID: ${eidr}`)
  }
  const data = await ma.getTitleByEIDR(eidr)
  return event.res.json(data)
})

app.start(8000)

Table of Contents

Configuration Configuration options

Connector actions:

getAllTitles Get all titles data

getTitleById Get title data by Movies Anywhere ID

getTitleByEIDR Get title data by EIDR ID

getTitlesByStudio Get titles data from a specific studio

Configuration options
const app = new Reshuffle()
const moviesAnywhereConnector = new MoviesAnywhereConnector(app)

Connector actions

Get all titles action

Definition:

() => {
  count: number,
  results: TitleData[],
}

Usage:

const { count, results } = await moviesAnywhereConnector.getAllTitles()

Retrieve all title information stored by Movies Anywhere.

Get title by ID action

Definition:

(
 id: string
) => TitleData

Usage:

const id = '7c1d0438-a71d-40a7-8567-6a4f714355cd'
const titleData = await moviesAnywhereConnector.getTitleById(id)

Get the title information associated with a given Movies Anywhere ID.

Get title by EIDR action

Definition:

(
 eidr: string
) => TitleData

Usage:

const eidr = '10.5240/CEFE-FECA-CBD0-F72A-E650-H'
const titleData = await moviesAnywhereConnector.getTitleByEIDR(eidr)

Get the title information associated with a given an EIDR ID, as specified by the EIDR API.

Get titles by studio action

Definition:

(
 studio: 'Disney' | 'Fox' | 'Lionsgate' | 'Sony' | 'Universal' | 'WB'
) => {
  count: number,
  results: TitleData[],
}

Usage:

const studio = 'Universal'
const { count, results } =
  await moviesAnywhereConnector.getTitlesByStudio(studio)

Retrieve all title information for movies released by the specified studio.