File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 < meta charset ="UTF-8 ">
55 < meta http-equiv ="X-UA-Compatible " content ="IE=edge ">
66 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
7- < title > Project GitHub Tracker</ title >
7+ < title > GitHub Tracker</ title >
88 < link rel ="stylesheet " href ="./style.css " />
99</ head >
10+
1011< body >
1112 < h1 > GitHub Tracker</ h1 >
1213 < h2 > Projects:</ h2 >
13- < main id ="projects "> </ main >
14+ < main id ="projects ">
15+ < div id ="container " class ="container ">
16+ </ div >
17+ </ main >
1418
1519 <!-- This will be used to draw the chart 👇 -->
1620 < canvas id ="chart "> </ canvas >
1721
1822 < script src ="./script.js "> </ script >
1923 < script src ="./chart.js "> </ script >
2024</ body >
25+
2126</ html >
Original file line number Diff line number Diff line change 1+ const username = 'mathildakarlsson'
2+ let reponame = ''
3+
4+
5+ //Fetch 1
6+ const API_URL = `https://api.github.com/users/${ username } /repos`
7+
8+ fetch ( API_URL )
9+ . then ( res => res . json ( ) )
10+ . then ( data => {
11+ console . log ( data )
12+ reponame = data [ 3 ] . name
13+
14+ data . forEach ( repo => {
15+ document . getElementById ( 'container' ) . innerHTML += `
16+ <div class="repo">
17+ <h4>${ repo . name } </h4>
18+ </div>
19+ `
20+ } )
21+
22+
23+
24+
25+ //Fetch 2
26+ const API_URL_PR = `https://api.github.com/repos/Technigo/${ reponame } /pulls`
27+
28+ fetch ( API_URL_PR )
29+ . then ( res => res . json ( ) )
30+ . then ( data => {
31+ console . log ( data )
32+ } )
33+ } )
Original file line number Diff line number Diff line change 11body {
22 background : # FFECE9 ;
3+ }
4+
5+ .container {
6+ display : grid;
7+ grid-template-columns : 2fr (1 );
38}
You can’t perform that action at this time.
0 commit comments