UNPKG

1.36 kBMarkdownView Raw
1# n-podcast-mapping
2
3Aggregated metadata and associated data for podcasts.
4
5## Installation
6
7```
8npm install -S @financial-times/n-podcast-mapping
9```
10
11## Usage
12
13```js
14const podcasts = require('@financial-times/n-podcast-mapping');
15
16// returns an array of external links for the given show
17const urls = podcasts.linksFor('ft-alphachat');
18
19console.log(urls); // [ 'https://itunes', 'http://soundcloud' ]
20
21// returns an array of TME tags for the given show
22const tags = podcasts.metadataFor('ft-banking-weekly');
23
24console.log(tags); // [ { id: "…", name: "…", taxonomy: "…" }, {…} ]
25
26// returns an array of primary TME tags used by each show
27const primaryTags = podcasts.primaryTags();
28
29console.log(primaryTags); // [ { id: "…", name: "…", taxonomy: "…" }, {…} ]
30
31// returns a de-duplicated array of all the TME tags used by the shows
32const uniqueTags = podcasts.uniqueTags();
33
34console.log(uniqueTags); // [ { id: "…", name: "…", taxonomy: "…" }, {…} ]
35
36// check if a tag ID is a type of podcast
37const tagId = 'NzA0NWQ2OTUtNDdhZC00ZGMxLWI4MGEtODZkYTY5MjQ0ZTk1-QnJhbmRz';
38
39console.log(podcasts.isThisTagAPodcast(tagId)); // true
40
41// returns an array of concept annotations for the given show
42const annotations = podcasts.annotationsFor('ft-arts');
43
44console.log(annotations); // [ { id: "…", prefLabel: "…", predicate: "…" }, {…} ]
45```