Skip to content

Instantly share code, notes, and snippets.

@Firesphere
Created July 14, 2018 02:28
Show Gist options
  • Save Firesphere/92b09c94beebd503a3fdb114d52e36d0 to your computer and use it in GitHub Desktop.
Save Firesphere/92b09c94beebd503a3fdb114d52e36d0 to your computer and use it in GitHub Desktop.
$suffixes = $result->getBody();
$count = 0;
$shaEnd = strtoupper($shaEnd);
$suffixes = explode("\r\n", $suffixes);
foreach ($suffixes as $suffix) {
list($suffix, $pwnCount) = explode(':', $suffix);
if ($suffix === $shaEnd) {
$count += (int)$pwnCount;
}
}
$shaStart = substr($sha, 0, 5);
$shaEnd = substr($sha, 5);
$client = new Client([
'base_uri' => static::PWND_API_URL
]);
$result = $client->request('GET', 'range/' . $shaStart, [
'headers' => [
'user-agent' => static::USER_AGENT,
'api-version' => static::API_VERSION
]
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment