Ejemplo n.º 1
0
function get_spider_log($atts)
{
    extract(shortcode_atts(array('text' => 'yes'), $atts));
    // 如只需要显示圆饼图,则设置text为no即可
    $fh = fopen(site_url() . "/mylogs.txt", "r");
    $contents = "";
    while (!feof($fh)) {
        $contents .= fread($fh, 8080);
    }
    fclose($fh);
    $str = "";
    // 显示日志结果的html文本
    $showtime = date("md");
    if ($text == "yes") {
        $str .= "当天蜘蛛爬行记录:";
        $str .= "<div style='background-color:#33A1C9;color:white;text-align:center;'>以下为国内常用蜘蛛。</div>";
    }
    $mytmp = array();
    // google
    $google = 0;
    if ($text == "yes") {
        $str .= "<a href=http://www.google.com/bot.html target=_blank>Google Spider</a>: ";
    }
    $mytmp = show_spider_result($showtime, $contents, "Googlebot\\/", $text);
    $google += $mytmp[0];
    $str .= $mytmp[1];
    $mytmp = show_spider_result($showtime, $contents, "Googlebot-Image\\/", $text);
    $google += $mytmp[0];
    $str .= $mytmp[1];
    $mytmp = show_spider_result($showtime, $contents, "Googlebot-Mobile\\/", $text);
    $google += $mytmp[0];
    $str .= $mytmp[1];
    $mytmp = show_spider_result($showtime, $contents, "Feedfetcher-Google", $text);
    $google += $mytmp[0];
    $str .= $mytmp[1];
    // baidu
    $baidu = 0;
    if ($text == "yes") {
        $str .= "<br><a href=http://www.baidu.com/search/spider.html target=_blank>Baidu Spider</a>: ";
    }
    $mytmp = show_spider_result($showtime, $contents, "Baiduspider\\/", $text);
    $baidu += $mytmp[0];
    $str .= $mytmp[1];
    $mytmp = show_spider_result($showtime, $contents, "Baiduspider-image", $text);
    $baidu += $mytmp[0];
    $str .= $mytmp[1];
    //bing
    $bing = 0;
    if ($text == "yes") {
        $str .= "<br><a href=http://www.bing.com/bingbot.htm target=_blank>bingbot Spider</a>: ";
    }
    $mytmp = show_spider_result($showtime, $contents, "bingbot\\/", $text);
    $bing += $mytmp[0];
    $str .= $mytmp[1];
    $mytmp = show_spider_result($showtime, $contents, "msnbot-media\\/", $text);
    $bing += $mytmp[0];
    $str .= $mytmp[1];
    //sogou
    $sogou = 0;
    if ($text == "yes") {
        $str .= "<br><a href=http://www.sogou.com/docs/help/webmasters.htm#07 target=_blank>Sogou Spider</a>: ";
    }
    $mytmp = show_spider_result($showtime, $contents, "Sogou web spider\\/", $text);
    $sogou += $mytmp[0];
    $str .= $mytmp[1];
    //soso
    $soso = 0;
    if ($text == "yes") {
        $str .= "<br><a href=http://help.soso.com/webspider.htm target=_blank>Soso Spider</a>: ";
    }
    $mytmp = show_spider_result($showtime, $contents, "Sosospider\\/", $text);
    $soso += $mytmp[0];
    $str .= $mytmp[1];
    if ($text == "yes") {
        $str .= "<div style='background-color:#FA8072;color:white;text-align:center;'>以下为垃圾蜘蛛,可屏蔽抓取。</div>";
    }
    //jike
    $else = 0;
    if ($text == "yes") {
        $str .= "<a href=http://shoulu.jike.com/spider.html target=_blank>Jike Spider</a>: ";
    }
    $mytmp = show_spider_result($showtime, $contents, "JikeSpider", $text);
    $else += $mytmp[0];
    $str .= $mytmp[1];
    //easou
    if ($text == "yes") {
        $str .= "<br><a href=http://www.easou.com/search/spider.html target=_blank>Easou Spider</a>: ";
    }
    $mytmp = show_spider_result($showtime, $contents, "EasouSpider", $text);
    $else += $mytmp[0];
    $str .= $mytmp[1];
    //yisou
    if ($text == "yes") {
        $str .= "<br>YisouSpider:";
    }
    $mytmp = show_spider_result($showtime, $contents, "YisouSpider", $text);
    $else += $mytmp[0];
    $str .= $mytmp[1];
    if ($text == "yes") {
        $str .= "<br><a href=http://yandex.com/bots target=_blank>YandexBot Spider</a>: ";
    }
    $mytmp = show_spider_result($showtime, $contents, "YandexBot\\/", $text);
    $else += $mytmp[0];
    $str .= $mytmp[1];
    if ($text == "yes") {
        $str .= "<br><a href=http://go.mail.ru/help/robots target=_blank>Mail.RU Spider</a>: ";
    }
    $mytmp = show_spider_result($showtime, $contents, "Mail.RU_Bot\\/", $text);
    $else += $mytmp[0];
    $str .= $mytmp[1];
    if ($text == "yes") {
        $str .= "<br><a href=http://www.acoon.de/robot.asp target=_blank>AcoonBot Spider</a>: ";
    }
    $mytmp = show_spider_result($showtime, $contents, "AcoonBot\\/", $text);
    $else += $mytmp[0];
    $str .= $mytmp[1];
    if ($text == "yes") {
        $str .= "<br><a href=http://www.exabot.com/go/robot target=_blank>Exabot Spider</a>: ";
    }
    $mytmp = show_spider_result($showtime, $contents, "Exabot\\/", $text);
    $else += $mytmp[0];
    $str .= $mytmp[1];
    if ($text == "yes") {
        $str .= "<br><a href=http://www.seoprofiler.com/bot target=_blank>spbot Spider</a>: ";
    }
    $mytmp = show_spider_result($showtime, $contents, "spbot\\/", $text);
    $else += $mytmp[0];
    $str .= $mytmp[1];
    $str .= draw_canvas($google, $baidu, $bing, $sogou, $soso, $else);
    return $str;
}
Ejemplo n.º 2
0
function model_pollutant_image($latitude, $longitude, $radius, $datetime, $numresults, $pollutant, $modeltype, $maxfit)
{
    $array = model_pollutant_grid($latitude, $longitude, $radius, $datetime, $numresults, $pollutant, $modeltype, $maxfit);
    draw_canvas($array);
}