Home php教程 PHP源码 Microsoft Xiaobing non-Api ice chat interface PHP

Microsoft Xiaobing non-Api ice chat interface PHP

Nov 08, 2016 am 11:40 AM

You need to obtain the SUB value of Weibo before using it. What is SUB? Sub is the cookie in the login state of your Weibo account. It’s the same type as Baidu’s bduss
How to get SUB?
Open the computer version of weibo.com and log in to your account. After successful login, open the browser developer tools (inspect element).

As shown in the picture, view all cookies of Weibo. The value after sub is SUB.
Picture http://7xrn7f.com1.z0.glb.clouddn.com/16-5-16/77590312.jpg
Paste sub into the code below. Note that SUB is required Uppercase
Format: SUB=************************************************ **********
It’s not over yet, open http://weibo.com/weiruanxiaobing and follow Xiaobing’s Weibo.
Then send her another private message.
He will reply to you and ask you to claim her. Bind your mobile phone number and you can claim it successfully.

After successfully receiving it, you can use the above interface to chat,

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

<?php

    //此处新浪微博SUB

     

     

     define(&#39;SUB&#39;,&#39;SUB=******************************************************&#39;);

     

     

    //end

    //临时cookies

    $cookie = dirname(__FILE__) . &#39;/weibo.tmp&#39;;

    //去除特殊字符

    $contents=htmlspecialchars($_GET[msg]);

    $contents=preg_replace("/\s/","",$contents);

    //post数据

    $post = array (

    &#39;content&#39;=>"$contents",

    &#39;rl&#39;=>&#39;2&#39;,

    &#39;uid&#39;=>&#39;5175429989&#39;,

    &#39;send&#39;=>&#39;发送&#39;

     );

     //curl模拟发送消息

     if($_GET[msg]){}else{

         echo &#39;你提交的内容为空!&#39;;

         exit;

     }

    $curl = curl_init();//初始化curl模块

    curl_setopt($curl, CURLOPT_URL, &#39;http://weibo.cn/msg/do/post?st=7b1272&#39;);//登录提交的地址

    curl_setopt($curl, CURLOPT_HEADER, 0);//是否显示头信息

    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);//是否自动显示返回的信息

    curl_setopt($curl, CURLOPT_COOKIE, SUB);

    curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie); //设置Cookie信息保存在指定的文件中

    curl_setopt($curl, CURLOPT_POST, 1);//post方式提交

    curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));//要提交的信息

    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);

    curl_exec($curl);//执行cURL

    curl_close($curl);//关闭cURL资源,并且释放系统资源

   sleep(1);

 //读取回复

    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, &#39;http://m.weibo.cn/msg/messages?uid=5175429989&page=1&#39;);

    curl_setopt($ch, CURLOPT_HEADER, 0);

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

    curl_setopt($ch, CURLOPT_COOKIE, SUB);

    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

    $ct = curl_exec($ch);

    curl_close($ch);

    $ct=json_decode($ct,1);

    //print_r($ct);

    $m=$ct[data][0][text];

    //替换

    $m=str_replace("分享语音","对方给你发送了一段语音。暂时无法显示",$m);

    $m=str_replace("分享图片","对方给你发送了图片音。暂时无法显示",$m);

    //返回的结果

    echo $m;

?>

Copy after login


Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1657
14
PHP Tutorial
1257
29
C# Tutorial
1230
24