diff --git a/src/lib/feeds/feedTypes.ts b/src/lib/feeds/feedTypes.ts new file mode 100644 index 0000000..4b55735 --- /dev/null +++ b/src/lib/feeds/feedTypes.ts @@ -0,0 +1,14 @@ +export interface AtomFeed { + title: string | null; + subtitle: string | null; + updated: string | null; + url: string | null; + content: PixelfedFeed[]; +} + +export interface PixelfedFeed { + title: string | null; + updated: string | null; + imgUrl: string | null; + pixelfedUrl: string | null; +} \ No newline at end of file diff --git a/src/lib/feeds/pixelfed.svelte b/src/lib/feeds/pixelfed.svelte new file mode 100644 index 0000000..69f7614 --- /dev/null +++ b/src/lib/feeds/pixelfed.svelte @@ -0,0 +1,78 @@ + +{#await loadFeed(pixelfedFeed)} +
Conneting to Pixelfed
+{:then feedData} +
Pixelfed
+

{feedData?.updated}

+ {#each feedData.content as feedItem} + + {feedItem.title} + + {feedItem.title} + {/each} +{:catch} +
Error connecting to Pixelfed
+{/await} + + \ No newline at end of file diff --git a/src/routes/testing/+page.server.ts b/src/routes/testing/+page.server.ts new file mode 100644 index 0000000..43dc657 --- /dev/null +++ b/src/routes/testing/+page.server.ts @@ -0,0 +1,11 @@ +import type { PageServerLoad } from "./$types"; + +export const load: PageServerLoad = async () => { + try { + const res = await fetch("https://pixelfed.scot/users/fbface.atom") + const xml = await res.text(); + return {xml: xml} + } catch (err) { + console.error("Error in load function", err) + } +} \ No newline at end of file diff --git a/src/routes/testing/+page.svelte b/src/routes/testing/+page.svelte new file mode 100644 index 0000000..6cb1f5c --- /dev/null +++ b/src/routes/testing/+page.svelte @@ -0,0 +1,8 @@ + + + \ No newline at end of file