Step-by-step to do WEBQQ robot-(iii) (login QQ and stay online)

Source: Internet
Author: User

x

The purpose of this article is to make your QQ real online: squeeze down your pcqq, and let your friends status bar display webqq on-line

The overall progress is probably 50%The full range is expected to have these steps, of course some of the steps may be merged:
    • Verification Code
    • First time Login
    • Second time landing
    • Stay online and receive messages
    • Get a list of friends and groups
    • Send Message
    • Become intelligent (*?∀?*)
Second time landing Real Online, 挤下PCQQ WebQQ在线状态 andFirst look at this request

Request message Analysis

      • Referer is not rare, the server request that first tells the TX is from here:http://d.web2.qq.com/proxy.html?v=20130916001&callback=1&id=2
      • The post data is in a JSON format: string.Format("r={{\"ptwebqq\":\"{0}\",\"clientid\":{1},\"psessionid\":\"\",\"status\":\"online\"}}", this.PtWebQQ, this.ClientID);

PTWEBQQ, is the value in the last article from the cookie, do not remember to go back to see ...

ClientID is a 8-length number, such as: 29528322 , the function is the user's unique identity, can be defined as a constant to represent, this can be arbitrary input

return value:

Retcode:0, indicating success.

Note:The result attribute psessionid and vfwebqq is the QQ token you landed this time, is the basis of successful landing, must be preserved

Here you will find PCQQ notice you: Your QQ landing elsewhere, you were forced to go offline. It's nice to have wood. (*?∇?)

But you're going to find out, in half a minute, your webqq is off the line? (つд '?), so please look down

Long polling poll stay online + get friends, group messages Request Description:

Request Address:http://d.web2.qq.com/channel/poll2

Referer:http://d.web2.qq.com/proxy.html?v=20130916001&callback=1&id=2

Post parameters:r:{"ptwebqq":"XXXX","clientid":XXXXX,"psessionid":"XXXXXX","key":""}

The above parameters have been saved in the previous operation.

This is a poll长轮询 browser Ajax to the server, timeout is long, when the server has your new message, the message back to you, or wait a long time to give you an empty message.

The server knows that you are still trying to get new messages, and you know that you are still online, that is, keep 在线状态 .

The message returned by the request, that is, 好友消息 or群消息

aware of a problem:

Before I tried to follow the process step after time, it occurred to me that the parsing of the return message depended on the access of the Friends list and the Q group list.

So I postponed the parsing part for the time being.

xClose So far, have been able to complete the landing, and remain online, get the message the next article will analyze the list of friends and Q groups, as well as some extensions

Using C # to impersonate an HTTP request can refer to the jab here

Do you have any interest in this article?

It's okay. WQNMLGB

.

Step-by-step to do WEBQQ robot-(iii) (login QQ and stay online)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.