Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Script used to verify fraudulent installs on PHPixie.
function getJsonPage($url)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
return json_decode($result, true);
$baseUrl = '';
$downloads = [];
foreach ([
] as $package) {
$apiUrl = $baseUrl . $package . '.json';
$data = getJsonPage($apiUrl);
if (!isset($data['package']) || !isset($data['package']['downloads'])) {
$downloads[$package] = $data['package']['downloads'];
$dumpFile = __DIR__ . '/dump/' . date('Y-m-d-H-i') . '.json';
file_put_contents($dumpFile, json_encode($downloads, JSON_PRETTY_PRINT));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.