Skip to content

Commit 78ce5f5

Browse files
author
Vic-Nas
committed
Removed token
1 parent d972bae commit 78ce5f5

1 file changed

Lines changed: 2 additions & 16 deletions

File tree

script.js

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
console.log('Script loaded');
22

3-
// Add your GitHub token here (optional - increases rate limit from 60 to 5000 requests/hour)
4-
// Get a token at: https://github.com/settings/tokens (no scopes needed)
5-
const GITHUB_TOKEN = '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'; // Example: 'ghp_xxxxxxxxxxxx'
6-
73
// State
84
const state = {
95
platforms: [],
@@ -27,12 +23,7 @@ async function fetchFolderContents(path) {
2723
}
2824

2925
try {
30-
const headers = { 'Accept': 'application/vnd.github.v3+json' };
31-
if (GITHUB_TOKEN) {
32-
headers['Authorization'] = `token ${GITHUB_TOKEN}`;
33-
}
34-
35-
const res = await fetch(`https://api.github.com/repos/${getRepoPath()}/contents/${path}`, { headers });
26+
const res = await fetch(`https://api.github.com/repos/${getRepoPath()}/contents/${path}`);
3627

3728
if (!res.ok) {
3829
console.error(`Failed to fetch ${path}: ${res.status} ${res.statusText}`);
@@ -273,12 +264,7 @@ async function renderProblem() {
273264

274265
if (pyFiles.length > 0) {
275266
try {
276-
const headers = { 'Accept': 'application/vnd.github.v3+json' };
277-
if (GITHUB_TOKEN) {
278-
headers['Authorization'] = `token ${GITHUB_TOKEN}`;
279-
}
280-
281-
const res = await fetch(`https://api.github.com/repos/${getRepoPath()}/contents/${pathStr}/${pyFiles[0].name}`, { headers });
267+
const res = await fetch(`https://api.github.com/repos/${getRepoPath()}/contents/${pathStr}/${pyFiles[0].name}`);
282268
if (res.ok) {
283269
const data = await res.json();
284270
pythonCode = atob(data.content);

0 commit comments

Comments
 (0)