Download the PHP package kilingzhang/smartqq-sdk-php without Composer

On this page you can find all versions of the php package kilingzhang/smartqq-sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package smartqq-sdk-php

smartqq-sdk-php

License Latest Stable Version

SmartQQ(WebQQ)

WebQQ腾讯公司推出的使用网页方式上QQ的服务,特点是无需下载和安装QQ软件,只要能打开WebQQ的网站就可以登录QQ与好友保持联系。官网首页 : http://w.qq.com/

smartqq-sdk-php

smartqq-sdk-php是对smartqq接口的基础封装。只是把一些处理类分离出sdk的代码层。让用户去实现具体的操作接口。更利代码的解耦。原理其实很简单,就是跨站请求伪造(CSRF), 伪造请求头,调用smartqq官方API。

注:请善待smartqq协议。希望不要因为肆意发送的广告而让此协议突然在某一天不复存在。因为现在的它已经很脆弱了,还web协议一片净土。虽然现在没人用web的协议了,都去用PC,安卓协议。虽然我也在用 溜

功能

快速开始

composer安装

composer require kilingzhang/smartqq-sdk-php

部署

<?php
use kilingzhang\SmartQQ\QQClient;
use kilingzhang\SmartQQ\Entity\ClientToken;

include __DIR__ . '/vendor/autoload.php';
//初始化QQClient,后续讲基于此会话调用各种方法
$QQ = new QQClient();
//设置二维码保存路径
$QQ->setQRCodePath('./qrcode.png');
//初始化用户登录令牌
$clientToken = new ClientToken();
//判断令牌是否为空(有无缓存登录状态)
if ($clientToken->isEmpty()) {
    //第一次登录
    $QQ->refreshQRCode();
    //验证二维码状态
    if ($QQ->QRlogin()) {
        //二次登陆
        $QQ->Login();
        //讲用户登录状态信息转换为登录令牌
        $clientToken = $QQ->getClienToken();
        //保存登录令牌
        $clientToken->save();
    }
} else {
    //获取已缓存的用户登录令牌
    $clientToken = ClientToken::toClientToken($clientToken->getClientTokenJson());
    //根据令牌设置用户会话
    $QQ->setClienToken($clientToken);
}
// 专门作为测试使用 内置了一次的Poll事件
$QQ->test();

[文档]

文档

[Demo]

基于smartqq-sdk-php 写的一个小Demo。完成了samrtqq中的所有基本事件操作。算是个入门的demo。后续我会基于此sdk更新一个QQ机器人完整的项目。把之前的SmartQQRobotByPHP重写一遍。

教程

当初抱着对QQ机器人的热情,最先接触也是新手最有可能实现的就是Smartqq的协议。但是当时感觉无从下手,网上的资料又老又不详细还不是PHP。所以想着给后来的Phper一个入门的机会。节省很多宝贵的时间。不要像我自己一样兜兜转转的绕圈子。而且个人觉得如果把Smartqq从抓包到分析协议整个流程搞明白,基本大部分web的爬虫抓包分析就没有问题了,剩下的就是熟练。所以也可以当做是一个爬虫分析的入门教程。文章还在更新中。。。

SmartQQ协议分析——登录(1)

[SmartQQ协议分析——登录(2)]()

[SmartQQ协议分析——获取列表]()

[SmartQQ协议分析——获取详细信息]()

[SmartQQ协议分析——Poll轮训获取消息]()

[SmartQQ协议分析——发送信息]()

[SmartQQ协议分析——其他]()

其他

retcode = 103 同一IP禁止多账号登录。 出现此状态码说明你的IP中存在多账号登录。此时只需要去官方地址的把账号注销掉就好了。 登录 http://w.qq.com/ 再从从设置中退出登录状态

retcode = 1202

感谢

灵感来自@ScienJus大大的文章。一年前我的入门就是从这位大大这里开始的。给了我进入QQ机器人大门的入场卷。当时大大还只有Ruby和java的版本。我就自己写了Python的版本。后来自己又写了PHP的版本,协议改变,到自己再更新协议。自此也有了这个项目和上文的教程,也算是尽自己的一点点贡献吧。不过最后因为太不稳定就转战去玩PC安卓协议的机器人了。溜

log

License

The MIT License (MIT)


All versions of smartqq-sdk-php with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
guzzlehttp/guzzle Version ~6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kilingzhang/smartqq-sdk-php contains the following files

Loading the files please wait ....