Mae's website :3 maemoon.me
personal website svelte sveltekit
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

logiverse stats

+145
+96
src/lib/logiverse.js
··· 1 + export const config = { 2 + version: '0.0.1', 3 + 4 + // I just made these gifs global since most instances use them anyways 5 + gifs: { 6 + berd: { 7 + src: 'https://www.todepond.com/image/berd.gif', 8 + alt: 'A sparkly bird gif' 9 + }, 10 + bot: { 11 + src: 'https://www.todepond.com/image/bot.gif', 12 + alt: 'A sparkly robot gif' 13 + }, 14 + tode: { 15 + src: 'https://www.todepond.com/image/tode.gif', 16 + alt: 'A sparkly toad gif' 17 + } 18 + }, 19 + instances: [ 20 + { 21 + name: 'todepond.com', 22 + admin: 'TodePond', 23 + 24 + frontend: 'https://todepond.com/lab/login', 25 + repository: 'https://github.com/TodePond/TodePondDotCom/tree/main/lab/login', 26 + 27 + endpoints: { 28 + feed: 'https://todepond-lablogingetusers.web.val.run', 29 + update: 'https://todepond-labloginupdatestatus.web.val.run', 30 + login: 'https://todepond-lablogin.web.val.run', 31 + delete: 'https://todepond-lablogindeleteaccount.web.val.run', 32 + ban: 'https://todepond-labloginbanuser.web.val.run', 33 + } 34 + }, 35 + { 36 + name: 'svenlaa.com', 37 + admin: 'Svenlaa', 38 + 39 + frontend: 'https://svenlaa.com/playground/loggo', 40 + repository: 'https://github.com/Svenlaa/svenlaa.com/tree/main/playground/loggo', 41 + 42 + endpoints: { 43 + feed: "https://svenlaa-lablogingetusers.web.val.run", 44 + update: 'https://svenlaa-labloginupdatestatus.web.val.run', 45 + login: 'https://svenlaa-lablogin.web.val.run', 46 + delete: 'https://svenlaa-lablogindeleteaccount.web.val.run', 47 + ban: 'https://svenlaa-labloginbanuser.web.val.run' 48 + } 49 + }, 50 + { 51 + name: 'evolved.systems', 52 + admin: 'evol', 53 + 54 + frontend: 'https://evolved.systems/logon', 55 + 56 + endpoints: { 57 + feed: 'https://evol-lablogingetusers.web.val.run', 58 + update: 'https://evol-labloginupdatestatus.web.val.run', 59 + login: 'https://evol-lablogin.web.val.run', 60 + delete: 'https://evol-labloginbanuser.web.val.run', 61 + ban: 'https://evol-labloginbanuser.web.val.run' 62 + } 63 + 64 + }, 65 + { 66 + name: 'rossilaz.xyz', 67 + admin: 'Rosy', 68 + 69 + frontend: 'https://login.rossilaz.xyz', 70 + repository: 'https://github.com/RosyArts/login-redux', 71 + 72 + endpoints: { 73 + feed: 'https://mittzy-lablogingetusers.web.val.run', 74 + update: 'https://mittzy-loginredux_updatestatus.web.val.run', 75 + login: 'https://mittzy-loginredux_login.web.val.run', 76 + delete: 'https://mittzy-loginredux_deleteaccount.web.val.run', 77 + ban: 'https://mittzy-loginredux_banuser.web.val.run', 78 + } 79 + }, 80 + { 81 + name: 'maemoon.me', 82 + admin: 'Mae', 83 + 84 + frontend: 'https://cute-catgirl.github.io/login/', 85 + repository: 'https://github.com/cute-catgirl/login', 86 + 87 + endpoints: { 88 + feed: 'https://maemoon-lablogingetusers.web.val.run', 89 + update: 'https://maemoon-labloginupdatestatus.web.val.run', 90 + login: 'https://maemoon-lablogin.web.val.run', 91 + delete: 'https://maemoon-lablogindeleteaccount.web.val.run', 92 + ban: 'https://maemoon-labloginbanuser.web.val.run' 93 + } 94 + } 95 + ] 96 + }
+24
src/routes/api/logiverse/count/+server.js
··· 1 + import { config } from '$lib/logiverse.js'; 2 + import { json } from '@sveltejs/kit'; 3 + 4 + export async function GET() { 5 + const instances = await Promise.all( 6 + config.instances.map(({ endpoints, name }) => 7 + fetch(endpoints.feed) 8 + .then(res => res.json()) 9 + .catch(() => ([])) 10 + .then(feed => ({ name, feed })) 11 + ) 12 + ); 13 + 14 + const counts = instances.reduce((acc, instance) => { 15 + if (Array.isArray(instance.feed)) { 16 + acc[instance.name] = instance.feed.length; 17 + } else { 18 + acc[instance.name] = 0; 19 + } 20 + return acc; 21 + }, {}); 22 + 23 + return json(counts); 24 + };
+3
src/routes/experiments/+page.svelte
··· 10 10 <li> 11 11 <a href="/experiments/click">click</a> 12 12 </li> 13 + <li> 14 + <a href="/experiments/logstats">logiverse stats</a> 15 + </li> 13 16 </ul>
+8
src/routes/experiments/logstats/+page.js
··· 1 + export const load = async ({ fetch }) => { 2 + const response = await fetch(`/api/logiverse/count`); 3 + const counts = await response.json(); 4 + 5 + return { 6 + counts 7 + }; 8 + };
+14
src/routes/experiments/logstats/+page.svelte
··· 1 + <script> 2 + function calculateTotal(values) { 3 + return Object.values(values).reduce((total, num) => total + num, 0); 4 + } 5 + let { data } = $props(); 6 + let sortedInstances = $derived(Object.entries(data.counts).sort(([, a], [, b]) => b - a)); 7 + </script> 8 + 9 + <h1>Logiverse stats</h1> 10 + <br> 11 + <h2>The logiverse currently has {calculateTotal(data.counts)} users</h2> 12 + {#each sortedInstances as [instance, count]} 13 + <h3>{instance} - {count}</h3> 14 + {/each}