Skip to content

Api Integration

Alli Shultes edited this page Nov 13, 2019 · 1 revision

This Api parses translated programme scripts, separating out the metadata and languages into a more usable format.

Endpoints

GET /status Returns 200

POST /reversion Takes a json representation of a programme script and outputs to the following schema:

script: [
  {
    section: 'Example section',
    shots: [
      {
        meta: [
          pix: '',
          graphics: '',
          shot: ''
        ],
        english: [],
        farsi: [],
        text: []
      }
    ]
  }
]

The body of the post request should be formatted as an array; an example can be found in this repo's /examples/ folder.

The api uses the npm package Franc to attempt to detect both languages in the programme script. The api currently only works with English and Farsi scripts, but can easily be refactored to work with two different languages using Franc, and by adding additional optional parameters to the request.

If the language of the text cannot be detected, the line of text is captured in the shot's text field.

Clone this wiki locally