abtmtr-v4/views/links/scripts/data_get_links.js

13 lines
363 B
JavaScript
Raw Normal View History

2023-11-26 06:55:00 +00:00
const data_get = document.getElementById("data_get");
fetch("https://pronouns.cc/api/v1/users/MeowcaTheoRange")
.then((x) => x.json())
.then((user) => {
data_get.innerHTML = user.links.reduce(
(html, link) =>
html +
`<h1><a href="${link}" target="_blank">${new URL(link).host}</a></h1>
<p>${link}</p>`,
""
);
});