From 45cf9558fe18bcf7c6f59585bb4dc3f3a769486e Mon Sep 17 00:00:00 2001 From: boyska Date: Sat, 18 Mar 2023 22:35:23 +0000 Subject: [PATCH] refactor --- src/js/podcast.js | 10 ++++++++++ src/pages/Show.vue | 8 ++------ 2 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 src/js/podcast.js diff --git a/src/js/podcast.js b/src/js/podcast.js new file mode 100644 index 0000000..45dee9b --- /dev/null +++ b/src/js/podcast.js @@ -0,0 +1,10 @@ +import fetch from 'isomorphic-unfetch' +import getPodcastFromFeed from "podparse" + +async function getPodcast(url) { + let feedContent = await fetch(url) + feedContent = await feedContent.text() + return await getPodcastFromFeed(feedContent) +} + +export default getPodcast diff --git a/src/pages/Show.vue b/src/pages/Show.vue index 9765493..c2ae5fb 100644 --- a/src/pages/Show.vue +++ b/src/pages/Show.vue @@ -17,9 +17,7 @@