Skip to content

Instantly share code, notes, and snippets.

@geraldotech
Created June 26, 2022 01:47
Show Gist options
  • Save geraldotech/f9414a4f3e1d527a344712133398e924 to your computer and use it in GitHub Desktop.
Save geraldotech/f9414a4f3e1d527a344712133398e924 to your computer and use it in GitHub Desktop.
fetch_repo_map
const api = "https://gh-pinned-repos.egoist.sh/?username=geraldotech";
loadE = document.querySelector("#loading");
container = document.querySelector("#container");
async function get(url){
response = await fetch(url)
console.log(response)
data = await response.json();
console.log(data)
loadE.classList.add("hide");
data.map((post)=>{
const div = document.createElement("div");
const title = document.createElement("h2");
//const body = document.createElement("p");
//const link = document.createElement("a");
title.innerText = post.repo;
div.appendChild(title)
container.appendChild(div)
})
}
get(api);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment