From f1e80ebb300fd4aaa085a9c59005c2e817963590 Mon Sep 17 00:00:00 2001 From: reidlab Date: Thu, 12 Feb 2026 00:51:19 -0800 Subject: [PATCH 1/3] the scrobblerrr --- src/components/Card.astro | 1 - src/components/LastFm.astro | 66 +++++++++++++++++++++++++++++++++++++ src/pages/index.astro | 4 +++ 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 src/components/LastFm.astro diff --git a/src/components/Card.astro b/src/components/Card.astro index b60d3d7..060a652 100644 --- a/src/components/Card.astro +++ b/src/components/Card.astro @@ -21,7 +21,6 @@ const { title } = Astro.props; } .card { - width: fit-content; /* the golden rule i think */ /* max-width: 800px is my everything */ max-width: 800px; diff --git a/src/components/LastFm.astro b/src/components/LastFm.astro new file mode 100644 index 0000000..42f77ff --- /dev/null +++ b/src/components/LastFm.astro @@ -0,0 +1,66 @@ +--- +--- + +
+ +
+

loading...

+ on loading...
+ by loading...
+ at +
+
+ + diff --git a/src/pages/index.astro b/src/pages/index.astro index 85f3a87..810be4c 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -3,6 +3,7 @@ import Layout from "../layouts/Layout.astro"; import Card from "../components/Card.astro"; import Badges from "../components/Badges.astro"; +import LastFm from "../components/LastFm.astro"; --- @@ -11,6 +12,9 @@ import Badges from "../components/Badges.astro";

this site was made as a dumping grounds for whatever i decide to put on here eventually, more coming soon, i promise!! the whole thing as a whole is still a work in progress

feel free to look around, and if you have any questions, feel free to ask me on my socials or contact me directly

+ + + From 21ad28c9800ec244b6ee32649fb59e45205ac8c6 Mon Sep 17 00:00:00 2001 From: reidlab Date: Thu, 12 Feb 2026 00:58:18 -0800 Subject: [PATCH 2/3] new badge --- src/content/badges/badges.yml | 4 ++++ src/content/badges/img/mini.png | Bin 0 -> 629 bytes 2 files changed, 4 insertions(+) create mode 100644 src/content/badges/img/mini.png diff --git a/src/content/badges/badges.yml b/src/content/badges/badges.yml index 1725fc0..2f5ffa1 100644 --- a/src/content/badges/badges.yml +++ b/src/content/badges/badges.yml @@ -91,3 +91,7 @@ path: "./img/spax.gif" alt: "spax dot zone" href: "https://spax.zone" +- slug: "mini" + path: "./img/mini.png" + alt: "miniaturity" + href: "https://minipa.ws/" diff --git a/src/content/badges/img/mini.png b/src/content/badges/img/mini.png new file mode 100644 index 0000000000000000000000000000000000000000..1fef46aebbf418e735d6c75234606e8363b34635 GIT binary patch literal 629 zcmeAS@N?(olHy`uVBq!ia0y~yV2EH~V36lvV_;xNKEd^Xfq{XsILO_JVcj{ImkbO{ z`kpS1AsLNtXKu_pWFXMSf8>(;hA2(_L)Q$xFwT%#8Fa)s<>Zk=&I(JszDNd$ZhWe^ zDsQTT4U@9$E$8s(Z!FX_EuYjYTI?(SRJd>R*#xQM>Kw0pl=u9wl3Dj##eA8ECIf>6 zQ)BcJPLa%_eb?+?{#~G@e~N7;U+LnLS-h^Z=GZqn@U5DDF3X_zaj*yfU5%hu>g>t; zII`lE1p*!@Ev@?BGe>FZD$5<`A8~Pox5WOsnR82mS(R&p3+n+{ZH9Ldj0MMErO3uS zlVo7%dEOoNMrFN{+a2C`2eqva{a;1R?M+}glxY(m^6q-0@y}vbJyY1hKgw0I9w&Lr?&ll_Ef%tiyb9wy_ zj8!Ohy_cd~w%AemLb#oA+acHL=(_^k5_Rzty5q!W=FD=dlT9&m-BVw)X>RQ8*Za)h z9zV&_R2>-X=qkT#%YyBT^VgNlNSpkE+qkp+01lp@sG-%TG^t3&mvhT$eC_aeW>bsF_rm9uP&Pb)1nE5Qs$Ao z1?>K%>8i`_yjC*QO#1nS Date: Tue, 17 Feb 2026 07:05:29 -0800 Subject: [PATCH 3/3] fix scrobblerrr --- src/components/LastFm.astro | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/LastFm.astro b/src/components/LastFm.astro index 42f77ff..4e32916 100644 --- a/src/components/LastFm.astro +++ b/src/components/LastFm.astro @@ -4,7 +4,7 @@
-

loading...

+

loading...

on loading...
by loading...
at @@ -15,28 +15,34 @@ const json = await fetch("https://lastfm.nkko.workers.dev/?method=user.getRecentTracks&user=reidlab") .then(res => res.json()) .catch(err => console.error("last.fm fail:", err)); + console.log(json); type LastFmResource = { "#text": T } const track = json.recenttracks.track[0] as { + "@attr"?: { nowplaying: boolean }, album: LastFmResource, artist: LastFmResource, - date: LastFmResource, + date?: LastFmResource, image: LastFmResource[], name: string, url: string, }; - const title = document.querySelector(".title") as HTMLHeadingElement; + // i think it's okay to have this be an anchor element + // the aria role is link if href is present, otherwise generic (https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/a#technical_summary) + // also briefly stated in the html spec (https://html.spec.whatwg.org/#the-a-element) + const title = document.querySelector(".title a") as HTMLAnchorElement; const album = document.querySelector(".album strong") as HTMLElement; const artist = document.querySelector(".artist strong") as HTMLElement; const time = document.querySelector(".time strong") as HTMLTimeElement; const cover = document.querySelector(".cover") as HTMLImageElement; title.innerText = track.name; + title.href = track.url; album.innerText = track.album["#text"]; artist.innerText = track.artist["#text"]; - time.innerText = new Date(track.date["#text"]).toLocaleString(undefined, { + time.innerText = (track.date && new Date(track.date["#text"]).toLocaleString(undefined, { dateStyle: "medium", timeStyle: "short" - }); + })) || (track["@attr"]?.nowplaying && "NOW!!!") || "epic error getting play time.."; // i chose a random thing from my library missing an album cover for this // but apparently this goes for any missing track? cuz everyone else is doing it