-
-
- YouTube
-
- {#each data.youtubeCommunityPosts as youtube}
-
- {/each}
+
+
+
+ Instagram
+
+
+ {#each data.instagramPosts as instagram}
+
+ {/each}
+
-
-
-
-
- Anstehende Streams
+
+
+
+ Reddit
+
+
+ {#each data.redditPosts.slice(0, matches ? 10 : 5) as reddit}
+
+ {/each}
+
-
- {#each data.upcomingStreams as stream}
-
- {/each}
+
+
+
+ Anstehende Streams
+
+
+ {#each data.upcomingStreams as stream}
+
+ {:else}
+
+ Momentan sind keine geplanten Streams bekannt.
+
+ {/each}
+
-
- Reddit
+
+ Neuste Videos
-
- {#each data.redditPosts as reddit}
-
+
-
-
-
- Neuste Videos
-
-
-
-
+
diff --git a/src/psaggregator/src/routes/api/+page.svelte b/src/psaggregator/src/routes/api/+page.svelte
index 9024cc4..7711337 100644
--- a/src/psaggregator/src/routes/api/+page.svelte
+++ b/src/psaggregator/src/routes/api/+page.svelte
@@ -13,7 +13,7 @@
const curlTwitch = `curl -X GET ${location.protocol}//${location.host}/api/twitch`;
const curlThumbnails = `curl -X GET ${location.protocol}//${location.host}/api/thumbnails?skip=0`;
const curlReddit = `curl -X GET ${location.protocol}//${location.host}/api/reddit`;
- const curlInformation = `curl -X GET ${location.protocol}//${location.host}/api/information?skip=0&date=${moment().format("YYYY-MM-DD")}`;
+ const curlInformation = `curl -X GET ${location.protocol}//${location.host}/api/information?skip=0&date=${moment().format("YYYY-MM-DD")}&type=YouTube`;
hljs.registerLanguage("bash", bash);
storeHighlightJs.set(hljs);
@@ -116,7 +116,9 @@
- pietsmiet.de Uploadplan
- YouTube Communityposts des Hauptkanals
+ - Instagram Posts der ersten Reihe
+
Über den ?type Parameter kannst du einen Filter auf die Importquelle anwenden.
Zukünftig sind hier noch Importe aus anderen Social Media geplant.
Ausblick
diff --git a/src/psaggregator/src/routes/api/information/+server.ts b/src/psaggregator/src/routes/api/information/+server.ts
index 6d89b06..878d78a 100644
--- a/src/psaggregator/src/routes/api/information/+server.ts
+++ b/src/psaggregator/src/routes/api/information/+server.ts
@@ -13,6 +13,8 @@ export async function GET({ url }) {
}
}
+ const type = url.searchParams.get("type") ?? undefined;
+
let date = null;
if (url.searchParams.has("date")) {
try {
@@ -35,16 +37,26 @@ export async function GET({ url }) {
date: {
lt: upperBound,
gt: lowerBound
- }
+ },
+ importedFrom: type,
+ },
+ include: {
+ InformationResource: true,
},
orderBy: {
date: "desc"
},
skip,
- take: 20
+ take: 20,
});
} else {
data = await prisma.information.findMany({
+ where: {
+ importedFrom: type,
+ },
+ include: {
+ InformationResource: true,
+ },
orderBy: {
date: "desc"
},
diff --git a/src/psaggregator/src/routes/news/+page.server.ts b/src/psaggregator/src/routes/news/+page.server.ts
index 490a65d..02f1493 100644
--- a/src/psaggregator/src/routes/news/+page.server.ts
+++ b/src/psaggregator/src/routes/news/+page.server.ts
@@ -16,10 +16,32 @@ export async function load() {
orderBy: {
date: "desc"
},
- take: 10
+ take: 20
+ });
+
+ const instagramPosts = await prisma.information.findMany({
+ where: {
+ importedFrom: {
+ equals: "Instagram"
+ },
+ href: {
+ not: null
+ },
+ date: {
+ not: null
+ }
+ },
+ include: {
+ InformationResource: true,
+ },
+ orderBy: {
+ date: "desc"
+ },
+ take: 20
});
return {
- youtubeCommunityPosts
+ youtubeCommunityPosts,
+ instagramPosts
};
}
diff --git a/src/psaggregator/src/routes/news/+page.svelte b/src/psaggregator/src/routes/news/+page.svelte
index 67386f5..542c816 100644
--- a/src/psaggregator/src/routes/news/+page.svelte
+++ b/src/psaggregator/src/routes/news/+page.svelte
@@ -1,10 +1,86 @@
@@ -18,23 +94,27 @@
{/each}
+ {#if loading[ImportType.YouTube]}
+
+ {/if}