Skip to content

Commit

Permalink
Added shortcode and script to fetch and display decentralized service…
Browse files Browse the repository at this point in the history
…s issues from GitHub API.
  • Loading branch information
sanity committed Jun 25, 2024
1 parent 4d10c5d commit 24d4d13
Showing 1 changed file with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<div id="decentralized-services-issues">
<p>Loading...</p>
</div>

<script>
async function fetchDecentralizedServicesIssues() {
const response = await fetch('https://api.github.com/repos/freenet/freenet-core/issues?state=open&labels=A-decentralized-services');
const issues = await response.json();
const container = document.getElementById('decentralized-services-issues');
container.innerHTML = '';

if (issues.length === 0) {
container.innerHTML = '<p>No open issues found with the "A-decentralized-services" label.</p>';
return;
}

const list = document.createElement('ul');
issues.forEach(issue => {
const listItem = document.createElement('li');
const date = new Date(issue.created_at).toLocaleDateString('en-US', {
year: 'numeric',
month: 'long',
day: 'numeric'
});
listItem.innerHTML = `<strong>${date}</strong> - <a href="${issue.html_url}" target="_blank">${issue.title}</a> by ${issue.user.login}`;
list.appendChild(listItem);
});

container.appendChild(list);
}

fetchDecentralizedServicesIssues();
</script>

0 comments on commit 24d4d13

Please sign in to comment.