File tree Expand file tree Collapse file tree 5 files changed +44
-1
lines changed
Expand file tree Collapse file tree 5 files changed +44
-1
lines changed Original file line number Diff line number Diff line change 55 < meta charset ="UTF-8 ">
66 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
77 < title > Krypto Hashers Community</ title >
8- < link rel ="icon " type ="image/png " href ="">
8+ < link rel ="icon " type ="image/png " href ="./Images/KHC Logo.png ">
99 < link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css " />
1010 < link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css ">
1111 < link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css ">
Original file line number Diff line number Diff line change 1+ const orgName = "Krypto-Hashers-Community" ;
2+ const apiUrl = `https://api.github.com/orgs/${ orgName } /repos` ;
3+ const membersApiUrl = `https://api.github.com/orgs/${ orgName } /members` ;
4+
5+
6+ fetch ( apiUrl )
7+ . then ( response => {
8+ if ( ! response . ok ) {
9+ throw new Error ( "Network response for repos was not OK" ) ;
10+ }
11+ return response . json ( ) ;
12+ } )
13+ . then ( repos => {
14+ let totalStars = 0 ;
15+ let totalForks = 0 ;
16+
17+ repos . forEach ( repo => {
18+ totalStars += repo . stargazers_count ;
19+ totalForks += repo . forks_count ;
20+ } ) ;
21+
22+ document . getElementById ( "stars-count" ) . textContent = totalStars ;
23+ document . getElementById ( "forks-count" ) . textContent = totalForks ;
24+ } )
25+ . catch ( error => {
26+ console . error ( "Error fetching stars and forks:" , error ) ;
27+ } ) ;
28+
29+
30+ fetch ( membersApiUrl )
31+ . then ( response => {
32+ if ( ! response . ok ) {
33+ throw new Error ( "Network response for members was not OK" ) ;
34+ }
35+ return response . json ( ) ;
36+ } )
37+ . then ( members => {
38+ const totalMembers = members . length ;
39+ document . getElementById ( "members-count" ) . textContent = totalMembers ;
40+ } )
41+ . catch ( error => {
42+ console . error ( "Error fetching members:" , error ) ;
43+ } ) ;
You can’t perform that action at this time.
0 commit comments