Github API http://developer.github.com/v3/repos/
The following contains HTML code designed to be used with Bootstrap.
<?php
$url = 'https://api.github.com/users/enqack/repos';
$repo_json = file_get_contents($url);
$repo_json = utf8_encode($repo_json);
$repo_array = json_decode($repo_json, true);
function output_repo_info(&$array) {
echo '<p><a target="repo" href="' . $array['html_url'] . '">'. $array['name'] . '</a>';
echo '<span class="pull-right btn btn-xs btn-default disabled">Last update: ' . explode('T', $array['updated_at'])[0] . '</span>';
if(empty($array['description'])) { $array['description'] = '(No description given)'; }
echo '<pre>' . $array['description'] . '</pre></p>';
}
echo '<div class="page-header"><h3>Original Repositories</h3></div><div class="well clearfix">';
foreach( $repo_array as $record ) {
if( $record['fork'] == false )
output_repo_info($record);
}
echo '</div>';
echo '<div class="page-header"><h3>Forked Repositories</h3></div><div class="well clearfix">';
foreach( $repo_array as $record ) {
if( $record['fork'] == true )
output_repo_info($record);
}
echo '</div>';
/*
echo '<pre>';
var_dump($repo_array);
echo '</div>';
*/
?>