Skip to content

Instantly share code, notes, and snippets.

@zQueal
Last active December 12, 2015 09:49
Show Gist options
  • Save zQueal/4754089 to your computer and use it in GitHub Desktop.
Save zQueal/4754089 to your computer and use it in GitHub Desktop.
PHP/cURL github API to return repositories open issue count.
<?php
function openIssues(){
$c = curl_init();
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Content-Type: application/json'));
curl_setopt($c, CURLOPT_URL, 'https://api.github.com/repos/xanza/xanza.github.com');
$content = curl_exec($c);
curl_close($c);
$api = json_decode($content);
print($api->open_issues_count);
}
return openIssues();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment