diff --git a/github-api.php b/github-api.php index 5e41521..9a5f53c 100644 --- a/github-api.php +++ b/github-api.php @@ -167,7 +167,7 @@ class github_api { $owner = trim( $owner, '/' ); $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/stats/contributors" ); return json_decode( $results['body'] ); @@ -202,4 +202,4 @@ class github_api { -} \ No newline at end of file +} diff --git a/github-embed.php b/github-embed.php index 9e762f6..8d6a127 100644 --- a/github-embed.php +++ b/github-embed.php @@ -252,16 +252,12 @@ class github_embed { foreach ( $contributors as $contributor ) { - $details = $this->api->get_user ($contributor->login); $response->html .= '
  • '; $response->html .= 'Picture of '.esc_attr($contributor->login).''; - if ( ! empty ( $details->name ) ) { - $response->html .= ''.esc_html($details->name)."
    "; - } + $response->html .= esc_url(add_query_arg(array('s'=>$gravatar_size), $contributor->author->avatar_url)); + $response->html .= '" alt="Picture of '.esc_attr($contributor->author->login).'">'; $response->html .= ''; - $response->html .= ''.esc_attr($contributor->login).''; + $response->html .= ''.esc_attr($contributor->author->login).''; } $response->html .= '';