|
|
@ -67,9 +67,12 @@ class github_api { |
|
|
|
|
|
|
|
|
|
|
|
// Allow users to supply auth details to enable a higher rate limit |
|
|
|
// Allow users to supply auth details to enable a higher rate limit |
|
|
|
if ( ! empty( $this->client_id ) && ! empty( $this->client_secret ) ) { |
|
|
|
if ( ! empty( $this->client_id ) && ! empty( $this->client_secret ) ) { |
|
|
|
$url = add_query_arg(array ( 'client_id' => $this->client_id, |
|
|
|
$url = add_query_arg( |
|
|
|
|
|
|
|
array( |
|
|
|
|
|
|
|
'client_id' => $this->client_id, |
|
|
|
'client_secret' => $this->client_secret ), |
|
|
|
'client_secret' => $this->client_secret ), |
|
|
|
$url ); |
|
|
|
$url |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$args = array( 'user-agent' => 'WordPress Github oEmbed plugin - https://github.com/leewillis77/wp-github-oembed'); |
|
|
|
$args = array( 'user-agent' => 'WordPress Github oEmbed plugin - https://github.com/leewillis77/wp-github-oembed'); |
|
|
@ -162,7 +165,7 @@ class github_api { |
|
|
|
$this->log( "get_repo_contributors( $owner, $repository )", GEDEBUG_CALL ); |
|
|
|
$this->log( "get_repo_contributors( $owner, $repository )", GEDEBUG_CALL ); |
|
|
|
|
|
|
|
|
|
|
|
$owner = trim( $owner, '/' ); |
|
|
|
$owner = trim( $owner, '/' ); |
|
|
|
$repo = trim ( $repo, '/' ); |
|
|
|
$repo = trim( $repository, '/' ); |
|
|
|
|
|
|
|
|
|
|
|
$results = $this->call_api( "https://api.github.com/repos/$owner/$repository/collaborators" ); |
|
|
|
$results = $this->call_api( "https://api.github.com/repos/$owner/$repository/collaborators" ); |
|
|
|
|
|
|
|
|
|
|
|