File tree Expand file tree Collapse file tree 1 file changed +2
-23
lines changed Expand file tree Collapse file tree 1 file changed +2
-23
lines changed Original file line number Diff line number Diff line change 1
1
console . log ( "hello" ) ;
2
- // Replace 'your_token_here' with your personal access token
3
- const token = "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" ;
4
- const headers = new Headers ( {
5
- Authorization : `token ${ token } ` ,
6
- } ) ;
7
-
8
- async function checkRateLimit ( ) {
9
- try {
10
- const response = await fetch ( "https://api.github.com/rate_limit" , {
11
- headers,
12
- } ) ;
13
- const rateLimit = await response . json ( ) ;
14
- const core = rateLimit . rate ;
15
- const resetTime = new Date ( core . reset * 1000 ) ;
16
- } catch ( error ) {
17
- console . error ( "Error fetching rate limit:" , error ) ;
18
- }
19
- }
20
-
21
- checkRateLimit ( ) ;
22
2
23
3
const nav = document . querySelectorAll ( "nav a" ) ;
24
4
nav . forEach ( ( el ) => {
@@ -45,11 +25,10 @@ searchBtn.addEventListener("click", () => {
45
25
} ) ;
46
26
47
27
async function searchprofile ( url , repo ) {
48
- checkRateLimit ( ) ;
49
28
50
- let search = await fetch ( url , { headers } ) ;
29
+ let search = await fetch ( url ) ;
51
30
let data = await search . json ( ) ;
52
- let fetchRepo = await fetch ( repo , { headers } ) ;
31
+ let fetchRepo = await fetch ( repo ) ;
53
32
let repos = await fetchRepo . json ( ) ;
54
33
fetchedData ( search , data , repos ) ;
55
34
}
You can’t perform that action at this time.
0 commit comments