Skip to content

Instantly share code, notes, and snippets.

@roberto-butti
Created February 11, 2018 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roberto-butti/7e53ead0df8de77581ae0a661ffd0cd0 to your computer and use it in GitHub Desktop.
Save roberto-butti/7e53ead0df8de77581ae0a661ffd0cd0 to your computer and use it in GitHub Desktop.
Laravel will be over the top!!!
<?php
$opts = [
'http' => [
'method' => 'GET',
'header' => [
'User-Agent: PHP Laravel will be over the TOP'
]
]
];
$context = stream_context_create($opts);
$url_laravel="https://api.github.com/repos/laravel/laravel";
$json_laravel = file_get_contents($url_laravel, false, $context);
$laravel = json_decode($json_laravel);
$laravel_star = $laravel->stargazers_count;
$url_meteor="https://api.github.com/repos/meteor/meteor";
$json_meteor = file_get_contents($url_meteor, false, $context);
$meteor = json_decode($json_meteor);
$meteor_star = $meteor->stargazers_count;
if ($laravel_star >= $meteor_star) {
echo "Laravel is over the top";
} else {
echo "Laravel is missing ".($meteor_star-$laravel_star)." stars";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment