-
Notifications
You must be signed in to change notification settings - Fork 0
/
playground.ts
52 lines (44 loc) · 1.41 KB
/
playground.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import getImdbData from "@/utils/getImdbData";
import generateEpisodePlotPoints from "@/utils/generateEpisodePlotPoints";
import type { EpisodeModel, ShowModel } from "@/utils/types";
import { getWikipediaData } from "@/utils/getWikipediaData";
const main = async () => {
const imdbId = "tt0582423";
const showWikidataId = "Q209282";
const showName = "Frasier";
const season = 1;
const number = 5;
const summaries = await getImdbData(imdbId);
const wikipedia = await getWikipediaData(imdbId, showWikidataId, season, number);
console.log("Wikipedia data", wikipedia);
console.log("IMDB data", summaries);
const show: ShowModel = {
tmdb_id: "123",
first_aired_at: null,
synced_at: null,
title: showName,
wikidata_id: showWikidataId,
image: null,
};
const episode: EpisodeModel = {
tmdb_id: "123",
imdb_id: imdbId,
show_id: "123",
season,
number,
first_aired_at: null,
synced_at: null,
title: "",
description: "",
main_plot_points: [],
all_plot_points: [],
imdb_summaries: summaries.summaries,
imdb_synopsis: summaries.synopsis,
wikipedia_text: wikipedia.text,
wikipedia_url: wikipedia.url,
images: [],
};
const plot = await generateEpisodePlotPoints(show, episode);
console.log(plot);
};
void main();