Selasa, 22 Juli 2014

Facebook ban domain checker


This script checks out whether your domain is banned from Facebook.

function curl_get($url){
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
    curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
    curl_setopt($ch, CURLOPT_REFERER, $url);
    curl_setopt($ch, CURLOPT_AUTOREFERER, true);
    curl_setopt($ch, CURLOPT_FAILONERROR, true);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
    curl_setopt($ch, CURLOPT_HEADER, true);
    curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
    curl_setopt($ch, CURLOPT_TIMEOUT, 30);
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    $result = curl_exec($ch);
    if ($error = curl_error($ch)) {
        return $error;
    }
    curl_close($ch);
    return trim($result);
}
     
function domainchecker($domain){
    if (strpos(curl_get("http://developers.facebook.com/tools/debug/og/object?q={$domain}"),"Error parsing input URL, no data was scraped") > 0 ) {
        $message = "<a href=\"http://{$domain}\">http://{$domain}</a> has been banned!";
    }else{
        $message = "<a href=\"http://{$domain}\">http://{$domain}</a> is not banned!";
    }
   
    return $message;
}
     
   
    if(isset($_GET['domain']) && $_GET['domain']!=null){
        if(filter_var(gethostbyname($_GET['domain']), FILTER_VALIDATE_IP))
        {
            echo domainchecker($_GET['domain']);
        }else{
            echo "Invalid Domain";
        }
    }
   
echo '<form action="" method="get">
<input type="text" value="" name="domain" />
<input type="submit" value="Check" name="check" />
</form>
<p>example: domain.com</p>' ;

0 komentar:

Posting Komentar