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

12 lines
372 B
JavaScript

const data_get = document.getElementById("data_get");
fetch_ask("https://pronouns.cc/api/v1/users/clhd8desmggedm3q1t3g")
.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>`,
""
);
});