コード例 #1
0
ファイル: wget.php プロジェクト: cmn32480/exec-irc-bot
<?php

#####################################################################################################
/*
exec:~wget|20|0|0|1|||||php scripts/wget.php %%trailing%%
*/
#####################################################################################################
require_once "lib.php";
require_once "wget_lib.php";
$trailing = trim($argv[1]);
term_echo("wget: {$trailing}");
if ($trailing == "") {
    privmsg("syntax: ~wget url delim 1 <> delim 2");
    return;
}
$result = quick_wget($trailing);
if ($result == False) {
    privmsg("syntax: ~wget url delim 1 <> delim 2");
    return;
}
if (strlen($result) > 300) {
    $result = trim(substr($result, 0, 300)) . "...";
}
privmsg(chr(3) . "07" . $result);
#####################################################################################################
コード例 #2
0
ファイル: weather.php プロジェクト: cmn32480/exec-irc-bot
         privmsg("location \"{$trailing}\" deleted");
     } else {
         if (trim($trailing) != "") {
             privmsg("location for \"{$trailing}\" not found");
         } else {
             privmsg("syntax: ~weather-del <name>");
         }
     }
     break;
 case "~weather-add":
     set_location_alias($alias, $trailing);
     break;
 case "~weather":
     if (strtolower($trailing) == "south pole") {
         require_once "wget_lib.php";
         $result = quick_wget("http://www.timeanddate.com/weather/antarctica/south-pole <div class=h1>Now</div> <> </div");
         if ($trailing == False or strlen($result) > 300) {
             privmsg("error");
             return;
         }
         privmsg("south pole temp: {$result}");
         return;
     }
     $data = process_weather($trailing, $nick);
     if ($data !== False) {
         privmsg($data);
     } else {
         privmsg("syntax: ~weather <location>");
     }
     break;
 case "~weather-old":