Skip to content

Instantly share code, notes, and snippets.

@RobinDev
Last active January 7, 2019 09:30
Show Gist options
  • Save RobinDev/e8d43e4befbb14baadd44194eb70d179 to your computer and use it in GitHub Desktop.
Save RobinDev/e8d43e4befbb14baadd44194eb70d179 to your computer and use it in GitHub Desktop.
Dev.piedweb.com
composer require piedweb/github
php render.php
<?php
include 'vendor/autoload.php';
use \PiedWeb\Github\ExtractRepoMetaData;
$args = new Symfony\Component\Console\Input\ArgvInput($argv);
$urls = [
'Tyrol' => 'https://github.com/PiedWeb/piedweb-tyrol-free-bootstrap-4-theme',
'https://github.com/PiedWeb/CMS',
'https://github.com/PiedWeb/RenderHtmlAttribute',
'https://github.com/PiedWeb/FileCache',
'https://github.com/PiedWeb/Github',
];
$packages = [];
$i = 2;
foreach ($urls as $name => $url) {
$github = new ExtractRepoMetaData($url, $name);
$key = (intval($github->getStars()) + $i/1000)*1000;
$packages[$key] = $github;
$i++;
}
krsort($packages);
foreach ($packages as $github) {
$name = $github->getName();
$description = $github->getDescription();
$stars = $github->getStars();
echo $name.' | '.$stars.' ☆'.chr(10).$description;
echo chr(10).'---------------------'.chr(10);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment