File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -112,3 +112,37 @@ document.addEventListener('DOMContentLoaded', function() {
112
112
fetchRepoStats ( ) ;
113
113
toggleStatsSection ( ) ;
114
114
} ) ;
115
+
116
+ document . addEventListener ( "DOMContentLoaded" , function ( ) {
117
+ fetchContributors ( ) ;
118
+
119
+ function fetchContributors ( ) {
120
+ const repoOwner = 'recodehive' ; // Replace with your repository owner
121
+ const repoName = 'machine-learning-repos' ; // Replace with your repository name
122
+ const apiUrl = `https://api.github.com/repos/${ repoOwner } /${ repoName } /contributors` ;
123
+
124
+ fetch ( apiUrl )
125
+ . then ( response => response . json ( ) )
126
+ . then ( contributors => {
127
+ const contributorsGrid = document . getElementById ( 'contributors-grid' ) ;
128
+
129
+ contributors . forEach ( contributor => {
130
+ const contributorDiv = document . createElement ( 'div' ) ;
131
+ contributorDiv . className = 'contributor' ;
132
+
133
+ contributorDiv . innerHTML = `
134
+ <img src="${ contributor . avatar_url } " alt="${ contributor . login } " class="contributor-image">
135
+ <div class="contributor-info">
136
+ <a href="${ contributor . html_url } " target="_blank" class="contributor-github">GitHub Profile</a>
137
+ </div>
138
+ ` ;
139
+
140
+ contributorsGrid . appendChild ( contributorDiv ) ;
141
+ } ) ;
142
+ } )
143
+ . catch ( error => {
144
+ console . error ( 'Error fetching contributors:' , error ) ;
145
+ } ) ;
146
+ }
147
+ } ) ;
148
+
You can’t perform that action at this time.
0 commit comments