GitHubリポジトリをリストしたいと思います。403リポジトリ検索APIを使用する際に禁止
Warning: file_get_contents(https://api.github.com/search/repositories?q=user:<username>): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden
My機能は次のとおりです。:
public function repoListAction()
{
$repositories = json_decode(file_get_contents('https://api.github.com/search/repositories?q=user:<put your username here>'), true);
return $this->render('full/repolist.html.twig', array(
'repositories' => $repositories,
));
}