-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathexample.ts
More file actions
50 lines (41 loc) · 1.79 KB
/
Copy pathexample.ts
File metadata and controls
50 lines (41 loc) · 1.79 KB
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
import PodcastIndexClient from "./src";
const client = new PodcastIndexClient({
key: process.env.API_KEY!,
secret: process.env.API_SECRET!,
enableAnalytics: true,
});
export async function log(thennable: Promise<unknown>): Promise<void> {
// eslint-disable-next-line no-console
console.log(JSON.stringify(await thennable, null, 2));
}
(async function runner() {
// const result = await client.search("Peace in their time");
// console.log(JSON.stringify(result));
// const feed = await client.episodesByFeedId(1333936);
// console.log(JSON.stringify(feed, null, 2));
// const foundFeed = await client.podcastByItunesId(1538359974);
// console.log(JSON.stringify(foundFeed, null, 2));
// await log(client.recentEpisodes({ max: 3 }));
// result.items.forEach((f) => console.log(f));
// result.feeds.forEach((f) => console.log(f.categories));
// console.log(await client.categories());
// const episodes = await client.episodesByFeedUrl("https://feeds.buzzsprout.com/217882.rss");
// const podcast = await client.episodesByFeedUrl("http://feeds.feedburner.com/FreeSexPodcast");
// console.log(JSON.stringify(feeds));
// console.log(podcast.items);
// console.log(JSON.stringify(await client.stats(), null, 2));
// await log(client.raw("/episodes/byid?id=1258727571"));
// await log(client.raw("/podcasts/byfeedid?id=75075"));
// await log(client.raw("/podcasts/byfeedid", { id: 75075 }));
// const result = await client.recentEpisodes({ max: 25 });
// console.log(
// `in order - ${result.items.reduce(
// (inOrder, currentItem, idx, all) =>
// inOrder && (idx === 0 || all[idx - 1].datePublished < currentItem.datePublished),
// true
// )}`
// );
await log(client.searchPerson("Adam Curry"));
})();
// 39633 categories
// 386307 categories