diff options
| author | Fuwn <[email protected]> | 2023-10-22 14:03:08 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-10-22 14:03:08 -0700 |
| commit | 0c6fbd9b1afe8e5967a127bffa68570ee88bfe92 (patch) | |
| tree | df5afd62f88a26e61bc92e3848d6d2c5a659dd7b /src/lib/Tools | |
| parent | feat(tools): default selection query (diff) | |
| download | due.moe-0c6fbd9b1afe8e5967a127bffa68570ee88bfe92.tar.xz due.moe-0c6fbd9b1afe8e5967a127bffa68570ee88bfe92.zip | |
feat(tools): episode discussion collector
Diffstat (limited to 'src/lib/Tools')
| -rw-r--r-- | src/lib/Tools/EpisodeDiscussionCollector.svelte | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/lib/Tools/EpisodeDiscussionCollector.svelte b/src/lib/Tools/EpisodeDiscussionCollector.svelte new file mode 100644 index 00000000..a9acd8ae --- /dev/null +++ b/src/lib/Tools/EpisodeDiscussionCollector.svelte @@ -0,0 +1,44 @@ +<script lang="ts"> + import { threads } from '$lib/AniList/forum'; + + let searchInput = ''; + let searchInputFinal = ''; +</script> + +<p> + <input type="text" placeholder="Username" bind:value={searchInput} /> + <a href={`#`} on:click={() => (searchInputFinal = searchInput)}>Search</a> +</p> + +{#if searchInputFinal !== ''} + {#await threads(searchInputFinal)} + Loading ... + {:then threads} + <ul> + {#each threads + .filter((thread) => thread.title.includes('[Spoilers]') && thread.title.includes('Episode')) + .sort((a, b) => b.createdAt - a.createdAt) as thread} + <li> + <a href={`https://anilist.co/forum/thread/${thread.id}`} target="_blank"> + {thread.title.replace('[Spoilers]', '')} + </a> + </li> + {/each} + </ul> + {:catch} + <p> + Threads could not be loaded. You might have been <a + href="https://en.wikipedia.org/wiki/Rate_limiting" + target="_blank">rate limited</a + >. + </p> + <p> + Try again in a few minutes. If the problem persists, please contact <a + href="https://anilist.co/user/fuwn" + target="_blank">@fuwn</a + > on AniList. + </p> + {/await} +{:else} + <p>Enter a username to search for to continue.</p> +{/if} |