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