From 78bae3c35c8f811774fa2782a1e3cfa68dd89be3 Mon Sep 17 00:00:00 2001 From: esteves-esta <26911877+esteves-esta@users.noreply.github.com> Date: Fri, 15 Dec 2023 22:05:19 -0300 Subject: [PATCH] fix fetcher --- README.md | 2 +- app/src/components/FeedProvider/fetcher.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 18afab8..944b6ff 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Formatting Humans of Seoul RSS feed to be to practice reading in koreand and be ![Header image ](/header-readme.png "Header") > ### Access app on the link: -> TODO +> https://esteves-esta.github.io/humans-of-seoul-feed-format/ ## Index diff --git a/app/src/components/FeedProvider/fetcher.ts b/app/src/components/FeedProvider/fetcher.ts index 4faf5f4..d5f5e7a 100644 --- a/app/src/components/FeedProvider/fetcher.ts +++ b/app/src/components/FeedProvider/fetcher.ts @@ -17,8 +17,10 @@ export async function fetcher(teste) { const response = await fetch(FEED_URL, { method: "GET" }); - const text = await response.text(); - const dataXML = new DOMParser().parseFromString(text, "text/xml"); + const json = await response.json() + // console.log(json.contents); + // const text = await json.contents.text(); + const dataXML = new DOMParser().parseFromString(json.contents, "text/xml"); const itemsHTML = dataXML.querySelectorAll("item"); const posts = parseDOM2JSON(itemsHTML);