Skip to content

Commit 7fefd14

Browse files
committed
Paging was simply wrong, it only followed by 1 page
1 parent 6cc9f65 commit 7fefd14

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

GitHubAnalytics.psm1

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,11 +1052,14 @@ function Get-NextResultPage
10521052
return $null
10531053
}
10541054

1055-
$nextLinkString = $jsonResult.Headers.Link.Split(',')[0]
1055+
$nextLinkString = $jsonResult.Headers.Link.Split(',').Where{ $_ -match 'rel="next"' }
1056+
if( $nextLinkString.Count -eq 0){
1057+
return $null
1058+
}
10561059

10571060
# Get url query for the next page
10581061
$query = $nextLinkString.Split(';')[0].replace('<','').replace('>','')
1059-
if ($query -notmatch '&page=1')
1062+
if ($query -notmatch '&page=1>')
10601063
{
10611064
return $query
10621065
}
@@ -1197,4 +1200,4 @@ function Get-WeekDate
11971200
}
11981201

11991202
return $beginningsOfWeeks
1200-
}
1203+
}

0 commit comments

Comments
 (0)