这个提示应该是提示要运行一下mysql注册一个用户信息,才能运行
QQ聊天机器人(QQ chatterbot)是一个用来模拟人类对话或聊天的程序."Eliza"和 "Parry"是早期非常著名的聊天机器人.它试图建立这样的程序:至少暂时性地让一个真正的人类认为他们正在和另一个人聊天.
qq聊天机器人的PHP原理
php
include"http_no_cookie.class.php";
classqq {
public$sid;
public$http;
public$qq_num;
function__construct() {
$this-http =newhttp_no_cookie;
}
functionlogin($qq_num,$qq_pwd) {
echo $data=$this-http-get("");
$action= preg_match("/action=\"(.◆)?\"/",$data,$matches);
$action=$matches[1];
$params=array();
$params["login_url"] ="";
$params["sidtype"] = 1;
$params["loginTitle"] ="手机腾讯网";
$params["bid"] = 0;
$params["qq"] =$qq_num;
$params["pwd"] =$qq_pwd;
$params["loginType"] =1;
echo$data=$this-http-post($action, http_build_query($params));
if(preg_match("/http:\/\/vc.gtimg.com\//",$data,$matches)){
echo"需要输入验证码";
return0;
exit;
if(preg_match("/密码错误/",$data,$matches)){
echo"密码错误";
return1;
$action= preg_match("/sid=(.◆?)/",$data,$matches);
$this-sid =$matches[1];
return$this-sid;
functionsendMsg($to_num,$msg,$sid= 0) {
$sid=$sid?$sid:$this-sid;
if(!$sid)
exit("sid值未传入进去");
$params["msg"] =$msg;
$params["u"] =$to_num;
$params["saveURL"] = 0;
$params["do"] ="send";
$params["on"] = 1;
$params["aid"] ="发送";
$url="".$sid;
echo$data=$this-http-post($url, http_build_query($params));
return$data;
functiongetMsg($qq_num= 0,$sid= 0) {
$qq_num=$qq_num?$qq_num:$this-qq_num;
if(!$qq_num)
exit("qq_num值未传入进去");
$data=$this-http-get($url);
preg_match("/name=\"u\" value=\"(\d◆)\"/",$data,$matches);
$result["qq"] =$matches[1];
$data=explode("form",$data);
$data=$data[0];
preg_match_all("/p(.◆)?\/p/",$data,$matches);
unset($matches[1][0]);
$result["content"] =$matches[1];
return$result;
functionlogout($sid){
$url="".$sid."aid=nLogout";
echo$url;
echo$this-http-get($url);
functiongetFriendsList($qq_num= 0,$sid= 0){
$result=array();
$url=";sid=".$sid."myqq=".$qq_num;
while(true){
$i=1;
$url.="p=".$i;
preg_match_all("/u=(.◆?)/",$data,$matches);
foreach($matches[1]as$key=$value){
$result[]=$value;
break;
$i◆◆;
//PHP代码
classhttp_no_cookie {
private$curl;
publicfunctionget($url) {
$this-curl = curl_init();
curl_setopt($this-curl, CURLOPT_URL,$url);
curl_setopt($this-curl, CURLOPT_HEADER, 0);
curl_setopt($this-curl, CURLOPT_USERAGENT,$this-user_agent);
curl_setopt($this-curl, CURLOPT_RETURNTRANSFER, 1);
$data= curl_exec($this-curl);
curl_close($this-curl);
publicfunctionpost($url,$params) {
curl_setopt($this-curl, CURLOPT_HEADER, 1);
curl_setopt($this-curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($this-curl, CURLOPT_POST, 1);
curl_setopt($this-curl, CURLOPT_POSTFIELDS,$params);
源码不知道,感觉当前是有不少网站在做这个的吧,酷Q就是,还有就是图灵机器人也可以用在QQ中,感觉不错
在软件上面安装需要的插件如问答系统,智能聊天,定时广播,每日签到,积分系统,QQ群管家,VIP群管,菜单插件,综合游戏等插件,再对机器人的插件功能进行相应的设置.
机器人进群以及在群里的功能设置.将登录软件的不常用QQ和设置的机器人软件管理员QQ加为好友,私聊机器人QQ给需要安装机器人的群授权后拉机器人QQ进群,即可在群里发送指令让机器人来管理QQ群.
QQ机器人是用易语言开发的.原理是从WEBQQ上获取信息,发送也是通过WEB发送的.
以上就是土嘎嘎小编为大家整理的phpq群机器人源码相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!