/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php /* EasyBots<http://www.easybots.cn> class by xuanyan <xunayan1983@gmail.com> */ // example: // receive user message: // $token = 'xxxxx'; // $param = EasyBots::getParam(); // if ($param['token'] == $token) // { // // var_dump($param); // } // //exit; // ---------------------------- // send message to user: // $oapi_id = 'xxxxx'; // $ack = 'xxxxx'; // $bot = new EasyBots($oapi_id, $ack, 'gtalk:easybots@gmail.com'); // $bot->send('palapla'); // // or // $bot2 = new EasyBots($oapi_id, $ack, // array( // 'gtalk:easybots@gmail.com', // 'msn:easybots@hotmail.com' // )); // $bot2->send('palapla'); class EasyBots { const URL = 'http://www.easybots.cn/oapi_mo.net'; private $oapi_id = null; private $ack = null; private $im = ''; public function __construct($oapi_id, $ack, $im) { } public function send($msg) { 'oapi_id' => $this->oapi_id, 'ack' => $this->ack, 'im' => $this->im, ); 'method' => 'POST', 'header'=> "Content-type: application/x-www-form-urlencoded " . ", 'content' => $data ) ); } public static function getParam() { ); } } ?>
Comments
