Created
February 11, 2018 15:08
-
-
Save SilentKernel/3c64a27d90ab325b148bd33f9d3c28d0 to your computer and use it in GitHub Desktop.
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 | |
// Sites | |
$sitesArray[] = "https://silentkernel.fr"; | |
$sitesArray[] = "https://storage.silentkernel.fr"; | |
// Users | |
$usersUrlArray[] = "https://smsapi.free-mobile.fr/sendmsg?user=xxxxxxx&pass=xxxxxxxxxx&msg="; | |
// Begin code | |
function getResponseInfo($url) | |
{ | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.23"); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); | |
curl_exec($ch); | |
$info = curl_getinfo($ch); | |
curl_close($ch); | |
return $info; | |
} | |
$resultString = ""; | |
foreach ($sitesArray as $url) { | |
$info = getResponseInfo($url); | |
if (!isset($info["http_code"])) { | |
$resultString .= " " . $url; | |
} elseif ($info["http_code"] != 200) { | |
$resultString .= " " . $url; | |
} | |
// Prevent flooding servers | |
sleep(1); | |
} | |
if ($resultString != "") { | |
$SMS = urlencode("Down :" . $resultString); | |
// var_dump($SMS); | |
foreach ($usersUrlArray as $userUrl) { | |
getResponseInfo($userUrl . $SMS); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment