Skip to content

Commit

Permalink
Updated for more repos
Browse files Browse the repository at this point in the history
- API uses paging, defaulting to 30 entries per page. We've got 33 so some were missing! Changed per_page to 50, but may have to update to better support paging given that the per_page limit is 100.
  • Loading branch information
500Foods committed Mar 6, 2024
1 parent 315e6c0 commit 0901291
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Unit1.pas
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function TForm1.GetTrafficData(repo: String): JSValue;
begin
// console.log('Retrieving ['+Repo+'] Data from GitHub');
WebRequest := TWebHTTPRequest.Create(Self);
WebRequest.URL := 'https://api.github.com/repos/'+repo+'/traffic/views';
WebRequest.URL := 'https://api.github.com/repos/'+repo+'/traffic/views?per_page=50';
WebRequest.Headers.AddPair('Accept','application/vnd.github+json');
WebRequest.Headers.AddPair('Authorization','Bearer '+GitHubToken);
WebResponse := await(TJSXMLHTTPRequest, WebRequest.Perform());
Expand Down Expand Up @@ -768,7 +768,7 @@ procedure TForm1.RefreshTableData;
WebEdit1.TextHint := 'Retrieving Repositories. Please Wait.';
WebRequest := TWebHTTPRequest.Create(Self);
WebRequest.URL := 'https://api.github.com/user/repos';
WebRequest.URL := 'https://api.github.com/user/repos?per_page=50';
WebRequest.Headers.AddPair('Accept','application/vnd.github+json');
WebRequest.Headers.AddPair('Authorization','Bearer '+Form1.GitHubToken);
WebResponse := await(TJSXMLHTTPRequest, WebRequest.Perform());
Expand Down

0 comments on commit 0901291

Please sign in to comment.