From 2b8e31a564d53bd0af82b8b1ed1bc9cb6730e547 Mon Sep 17 00:00:00 2001 From: MeowcaTheoRange Date: Sun, 26 Nov 2023 14:25:54 -0600 Subject: [PATCH] more pronouns.cc apis... --- views/branding/scripts/data_get_member.js | 23 ++++++++---- views/index.html | 45 +---------------------- views/scripts/data_get_whoami.js | 12 ++++++ 3 files changed, 28 insertions(+), 52 deletions(-) diff --git a/views/branding/scripts/data_get_member.js b/views/branding/scripts/data_get_member.js index fe07271..da62371 100644 --- a/views/branding/scripts/data_get_member.js +++ b/views/branding/scripts/data_get_member.js @@ -1,15 +1,22 @@ const characters = document.getElementById("characters"); -fetch( - "https://pronouns.cc/api/v1/users/MeowcaTheoRange/members/CurrentCharacter" -) + +const CURRENT_CHARACTER = "meowcatheorange/iszac"; + +fetch(`https://beta.trollcall.xyz/api/troll/${CURRENT_CHARACTER}`) .then((x) => x.json()) - .then((member) => { + .then((char) => { + var name = char.name + .map((string) => { + string = string[0].toUpperCase() + string.slice(1); + return string; + }) + .join(" "); characters.querySelector( ".characterName" - ).innerHTML = `${member.display_name}`; - characters.querySelector(".characterImage").src = member.links[0]; - characters.querySelector(".pronouns").innerHTML = member.pronouns - .map((pronoun) => pronoun.pronouns.split("/")[0]) + ).innerHTML = `${name}`; + characters.querySelector(".characterImage").src = char.images[0]; + characters.querySelector(".pronouns").innerHTML = char.pronouns + .map((pronoun) => pronoun[0]) .join("/"); characters.style.display = null; }); diff --git a/views/index.html b/views/index.html index 4d44b90..f347f07 100755 --- a/views/index.html +++ b/views/index.html @@ -63,50 +63,7 @@ Cool Flags -
-

What I like doing

-

- My favourite hobbies are programming, drawing, - occasionally making small bits of music, - obsessing over fonts, and being pedantic. -

-
-
-

What I'd like you to know about me

- -
-
-

What I believe in

- -
+
diff --git a/views/scripts/data_get_whoami.js b/views/scripts/data_get_whoami.js index 4849c68..040541c 100644 --- a/views/scripts/data_get_whoami.js +++ b/views/scripts/data_get_whoami.js @@ -3,6 +3,7 @@ const time = document.getElementById("time"); const weekday = document.getElementById("weekday"); const timezone = document.getElementById("timezone"); const nofetchy = document.getElementById("no-fetchy"); +const fields = document.getElementById("fields"); fetch("https://pronouns.cc/api/v1/users/MeowcaTheoRange") .then((x) => x.json()) .then((user) => { @@ -31,4 +32,15 @@ fetch("https://pronouns.cc/api/v1/users/MeowcaTheoRange") } window.requestAnimationFrame(updateTime); nofetchy.style.display = null; + fields.innerHTML = user.fields + .map( + (fieldset) => ` +
+

${fieldset.name}

+ +
` + ) + .join(""); });