more pronouns.cc apis...

This commit is contained in:
MeowcaTheoRange 2023-11-26 14:25:54 -06:00
parent ef51ddc89a
commit 2b8e31a564
3 changed files with 28 additions and 52 deletions

View file

@ -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 = `<a href="${member.bio}" target="_blank">${member.display_name}</a>`;
characters.querySelector(".characterImage").src = member.links[0];
characters.querySelector(".pronouns").innerHTML = member.pronouns
.map((pronoun) => pronoun.pronouns.split("/")[0])
).innerHTML = `<a href="https://beta.trollcall.xyz/troll/${CURRENT_CHARACTER}" target="_blank">${name}</a>`;
characters.querySelector(".characterImage").src = char.images[0];
characters.querySelector(".pronouns").innerHTML = char.pronouns
.map((pronoun) => pronoun[0])
.join("/");
characters.style.display = null;
});

View file

@ -63,50 +63,7 @@
Cool Flags
</button>
</section>
<section>
<h2>What I like doing</h2>
<p>
My favourite hobbies are <b>programming</b>, <b>drawing</b>,
<b>occasionally making small bits of music</b>,
<b>obsessing over fonts</b>, and <b>being pedantic</b>.
</p>
</section>
<section>
<h2>What I'd like you to know about me</h2>
<ul>
<li>Please be patient with me.</li>
<li>
Please be understanding! Ask me for clarification if required.
</li>
<li>
I don't really like small talk - keep if brief if you want to check
up on me, please.
</li>
<li>
I'm not one to pick sides at first, usually. Being an "all or
nothing" kind of person isn't my thing, and if you don't like that,
feel free to tell me why your side is good.
</li>
<li>
I like getting tangled up in drama, but I'm not a spiteful person -
I'm usually only in it for the correlations.
</li>
<li>
You may see me hyperfixate on random stuff, like certain fonts or
public transit.
</li>
</ul>
</section>
<section>
<h2>What I believe in</h2>
<ul>
<li>Self-hosting important or personal infrastructure</li>
<li>Free and open-source material</li>
<li>Privacy as a basic human right</li>
<li>Trans rights &amp; gay rights</li>
<li>Autistic superiority <small>/joke</small></li>
</ul>
</section>
<section id="fields"></section>
</main>
<div id="WindowHolder"></div>
<section id="accessibility" hidden></section>

View file

@ -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) => `
<section>
<h2>${fieldset.name}</h2>
<ul>${fieldset.entries
.map((entry) => `<li>${entry.value}</li>`)
.join("")}</ul>
</section>`
)
.join("");
});