I’m trying to get all downloads from an repo on github with help of https://github.com/ornicar/php-github-api
There is no download Object in this project, so i’ve created my own:
class Github_Api_Download extends Github_Api{
public function getDownloads($repo, $username){
$string = 'repos/'.urlencode($username).'/'.urlencode($repo).'/downloads';
$response = $this->get($string);
die(print_r($response));
return $response;
}
}
When i run this, i’m getting only
Server Error
HTTP 401: Unauthorized
- it should be possible to get this without authentication too, because if i use the url in the browser, it’s working
- my authentication is working, because all the actions (e.g. create new repo,etc..) are working fine
Anybody can help me?:)
I was looking for this earlier, so I wrote my own little function and posted it on my blog. Hope this helps.
Check this out