export default async function fetchNewPublicGitHubRepos() {
const today = new Date().toISOString().split("T")[0];
const query = `created:>=${today}`;
const sort = "created";
const order = "desc";
const url = `https://api.github.com/search/repositories?q=${encodeURIComponent(query)}&sort=${sort}&order=${order}`;
const response = await fetch(url, {
headers: {
"Accept": "application/vnd.github.v3+json",
"User-Agent": "Deno-GitHub-Repo-Fetcher",
},
});
if (!response.ok) {
throw new Error(`GitHub API responded with status: ${response.status}`);
}
return response.json();
}