Fix #14 make mastodon instance configurable
This commit is contained in:
parent
5dd20cd6a0
commit
a3751c985b
@ -1,6 +1,8 @@
|
|||||||
HASHTAG_FILTER = ichlausche,music,musik,nowplaying,tunetuesday,nowlistening
|
HASHTAG_FILTER = ichlausche,music,musik,nowplaying,tunetuesday,nowlistening
|
||||||
URL_FILTER = song.link,album.link,spotify.com,music.apple.com,bandcamp.com
|
URL_FILTER = song.link,album.link,spotify.com,music.apple.com,bandcamp.com
|
||||||
YOUTUBE_API_KEY = CHANGE_ME
|
YOUTUBE_API_KEY = CHANGE_ME
|
||||||
|
MASTODON_INSTANCE = 'metalhead.club'
|
||||||
VERBOSE = false
|
VERBOSE = false
|
||||||
|
|
||||||
PUBLIC_REFRESH_INTERVAL = 10000
|
PUBLIC_REFRESH_INTERVAL = 10000
|
||||||
|
PUBLIC_MASTODON_INSTANCE_DISPLAY_NAME = 'Metalhead.club'
|
@ -1,4 +1,4 @@
|
|||||||
import { HASHTAG_FILTER, URL_FILTER, YOUTUBE_API_KEY } from '$env/static/private';
|
import { HASHTAG_FILTER, MASTODON_INSTANCE, URL_FILTER, YOUTUBE_API_KEY } from '$env/static/private';
|
||||||
import type { Post, Tag, TimelineEvent } from '$lib/mastodon/response';
|
import type { Post, Tag, TimelineEvent } from '$lib/mastodon/response';
|
||||||
import { savePost } from '$lib/server/db';
|
import { savePost } from '$lib/server/db';
|
||||||
import { WebSocket } from "ws";
|
import { WebSocket } from "ws";
|
||||||
@ -55,7 +55,7 @@ export class TimelineReader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private constructor() {
|
private constructor() {
|
||||||
const socket = new WebSocket("wss://metalhead.club/api/v1/streaming")
|
const socket = new WebSocket(`wss://${MASTODON_INSTANCE}/api/v1/streaming`);
|
||||||
socket.onopen = (_event) => {
|
socket.onopen = (_event) => {
|
||||||
socket.send('{ "type": "subscribe", "stream": "public:local"}');
|
socket.send('{ "type": "subscribe", "stream": "public:local"}');
|
||||||
};
|
};
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import { onMount } from "svelte";
|
import { onMount } from "svelte";
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import type { Post } from '$lib/mastodon/response';
|
import type { Post } from '$lib/mastodon/response';
|
||||||
import { PUBLIC_REFRESH_INTERVAL } from '$env/static/public';
|
import { PUBLIC_REFRESH_INTERVAL, PUBLIC_MASTODON_INSTANCE_DISPLAY_NAME } from '$env/static/public';
|
||||||
import PostComponent from '$lib/components/PostComponent.svelte';
|
import PostComponent from '$lib/components/PostComponent.svelte';
|
||||||
import LoadMoreComponent from '$lib/components/LoadMoreComponent.svelte';
|
import LoadMoreComponent from '$lib/components/LoadMoreComponent.svelte';
|
||||||
|
|
||||||
@ -76,9 +76,9 @@ async function loadOlderPosts() {
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
<title>Metalhead.club music list</title>
|
<title>{PUBLIC_MASTODON_INSTANCE_DISPLAY_NAME} music list</title>
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
<h2>Metalhead.club music list</h2>
|
<h2>{PUBLIC_MASTODON_INSTANCE_DISPLAY_NAME} music list</h2>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<div></div>
|
<div></div>
|
||||||
<div class="posts">
|
<div class="posts">
|
||||||
|
Loading…
Reference in New Issue
Block a user