示例#1
0
 public static function authenticateUser($email, $token)
 {
     $headers[] = sprintf('Authorization: token %s', $token);
     $url = 'https://api.github.com/user';
     $response = CurlComunication::simpleGet($url, $headers);
     if ($response->email != $email) {
         return false;
     }
     return true;
 }
示例#2
0
文件: Git.php 项目: sq3hll/github_Api
 public static function searchRepositores($query)
 {
     $url = 'https://api.github.com/search/repositories?q=' . $query;
     $response = CurlComunication::simpleGet($url);
     $list = [];
     foreach ($response->items as $item) {
         $list[] = array("id" => $item->id, "name" => $item->full_name, "description" => $item->description, "owner" => $item->owner->login, "url" => $item->html_url, "fork_url" => $item->forks_url);
     }
     return $list;
 }