Skip to content

Commit

Permalink
feat: adding github api fetch to get information and links generated …
Browse files Browse the repository at this point in the history
…automatically
  • Loading branch information
Dozom committed Jun 6, 2024
1 parent cb85ca7 commit 15d418d
Showing 1 changed file with 26 additions and 38 deletions.
64 changes: 26 additions & 38 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,17 @@

.technologies {
margin-bottom: 16px;
}

a {
color: white;
}
</style>


</head>

<body>
<body onload="getRepos()">
<section class="delicious-handrawn-regular header">
<h1 class="underline">DESARROLLADOR WEB</h1></i>
</section>
Expand Down Expand Up @@ -224,43 +227,7 @@ <h1 class="underline">Experiencia</h1>
<section class="projects">
<h1 class="underline">Proyectos</i></h1>
<section class="content">
<ul>
<li>
Barbaqueue
</li>
<li>
Android Alphabet Soup
</li>
<li>
Cubes
</li>
<li>
Barbaqueue
</li>
<li>
Android Alphabet Soup
</li>
<li>
Cubes
</li>
<li>
Barbaqueue
</li>
<li>
Android Alphabet Soup
</li>
<li>
Cubes
</li>
<li>
Barbaqueue
</li>
<li>
Android Alphabet Soup
</li>
<li>
Cubes
</li>
<ul class="content-elements">
</ul>

</section>
Expand All @@ -286,6 +253,27 @@ <h1 class="underline">Contáctame</h1>
</section>

</section>
<script>
function getRepos() {
let parentElement = document.getElementsByClassName('content-elements')[0]
fetch('https://api.github.com/users/dozom/repos?sort=created&direction=desc')
.then(response => response.json())
.then(data => {
data.forEach(repo => {
let newElement = document.createElement('p')
let a = document.createElement('a');
a.textContent = repo.name
a.href = repo.html_url;
a.target = '_blank';
newElement.appendChild(a)
parentElement.appendChild(newElement)
})
}
)
.catch(error => console.error('Error:', error));

}
</script>
</body>

</html>

0 comments on commit 15d418d

Please sign in to comment.