-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
54 lines (46 loc) · 1.69 KB
/
index.html
File metadata and controls
54 lines (46 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Unavailable Index</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<h1>Unavailable Index</h1>
<div id="repos"></div>
</div>
<script>
// Function to fetch and display repositories from a specific branch
async function fetchRepos() {
try {
const response = await fetch('https://api.github.com/users/yesEngineer/repos');
const repos = await response.json();
const reposDiv = document.getElementById('repos');
for (const repo of repos) {
const branchesResponse = await fetch(`https://api.github.com/repos/yesEngineer/${repo.name}/branches`);
const branches = await branchesResponse.json();
const unavailableBranch = branches.find(branch => branch.name === 'unavailable');
if (unavailableBranch) {
const repoDiv = document.createElement('div');
repoDiv.classList.add('file-item');
const repoLink = document.createElement('a');
repoLink.textContent = repo.name;
repoLink.href = `${repo.html_url}`;
repoLink.target = '_blank';
repoDiv.appendChild(repoLink);
const repoDesc = document.createElement('p');
repoDesc.textContent = repo.description || 'No description provided';
repoDiv.appendChild(repoDesc);
reposDiv.appendChild(repoDiv);
}
}
} catch (error) {
console.error('Error fetching repositories:', error);
}
}
fetchRepos();
</script>
</body>
</html>