Created
June 26, 2022 01:47
-
-
Save geraldotech/f9414a4f3e1d527a344712133398e924 to your computer and use it in GitHub Desktop.
fetch_repo_map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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