Created
July 14, 2018 02:28
-
-
Save Firesphere/92b09c94beebd503a3fdb114d52e36d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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