We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f7c60ea commit 807d7bbCopy full SHA for 807d7bb
1 file changed
webqq/client.py
@@ -313,8 +313,21 @@ def get_friends_account(friends_uin):
313
def get_new_msg():
314
"""
315
获取最新消息(轮询)
316
+ 备注:请求到返回时间大概10S
317
+ 可以用死循环模拟轮询
318
- pass
319
+ new_msg_url = 'http://d.web2.qq.com/channel/poll2'
320
+ header['Host'] = 'd.web2.qq.com'
321
+ header['Referer'] = 'http://d.web2.qq.com/proxy.html?v=20130916001&callback=1&id=2'
322
+ new_msg_dict = {
323
+ "ptwebqq": ptwebqq,
324
+ "clientid": ClientID,
325
+ "psessionid": PSessionID,
326
+ "key": ""
327
+ }
328
+ new_msg_payload = {'r': json.dumps(new_msg_dict)}
329
+ response = s.post(new_msg_url, data=new_msg_payload, headers=header)
330
+ return json.loads(response.content)
331
332
333
if __name__ == "__main__":
0 commit comments