Created
February 11, 2018 17:12
-
-
Save roberto-butti/7e53ead0df8de77581ae0a661ffd0cd0 to your computer and use it in GitHub Desktop.
Laravel will be over the top!!!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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