Last active
December 12, 2015 09:49
-
-
Save zQueal/4754089 to your computer and use it in GitHub Desktop.
PHP/cURL github API to return repositories open issue count.
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
<?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