JavaScript-Is this Microsoft Xiaoice interface useful? Everybody, give me a try.

Source: Internet
Author: User
Keywords Javascript php python java node.js
Tags set cookie

Microsoft Xiaoice No API interface, Turing Man's too garbage.
This is an interface that I write myself, let me try that.

How to use
Get
http://localhost/xb.php?msg= Content
Return
Returns the contents of a Xiaoice reply

Need to get the sub value of Weibo before use, what is a sub? Sub is the cookie that your Weibo account is logged into. And Baidu's Bduss is the same type of thing
How do I get a sub?
Open the computer version weibo.com login to your account. After successful login, open the Browser developer tool (review Element).

To view all cookies for Weibo. The value behind the sub is the sub.

Paste the sub into the following code, note that the sub is capitalized
Format: sub=
It's not over yet, open the http://weibo.com/weiruanxiaobing and follow Xiaoice Weibo.
And then send her a private message.
He will reply you to ask you to collect her, bind your mobile number, you can claim success.
After successful collection, you can use the above interface to chat,

Here's my Code.


  "$contents", ' rl ' = ' 2 ', ' uid ' = ' ' 5175429989 ', ' send ' and ' = ' sent '); Curl Analog Send Message if ($_get[msg]) {}else{echo ' your submitted content is empty!         ';     Exit     } $curl = Curl_init ();//Initialize the Curl module curl_setopt ($curl, Curlopt_url, ' http://weibo.cn/msg/do/post?st=7b1272 ');//Login submitted address curl_setopt ($curl, Curlopt_header, 0);//whether to display header information curl_setopt ($curl, Curlopt_returntransfer, 1);//Whether the returned information is automatically displayed curl    _setopt ($curl, Curlopt_cookie, SUB); curl_setopt ($curl, Curlopt_cookiejar, $cookie); Set cookie information to be saved in the specified file curl_setopt ($curl, Curlopt_post, 1);//post mode Submit curl_setopt ($curl, Curlopt_postfields, Http_bui    Ld_query ($post));//information to be submitted curl_setopt ($curl, curlopt_followlocation, 1); Curl_exec ($curl);//Perform Curl Curl_close ($curl);//Close Curl Resource and release system resources sleep (1);    Read reply $ch = Curl_init ();    curl_setopt ($ch, Curlopt_url, ' http://m.weibo.cn/msg/messages?uid=5175429989&page=1 ');    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]; Replace $m =str_replace ("Share voice", "the other party sends you a voice.")    Temporarily unable to display ", $m); $m =str_replace ("Share Picture", "the other party sent you a picture tone.")    Temporarily unable to display ", $m); Returns the result of the Echo $m;? >

Reply content:

Microsoft Xiaoice No API interface, Turing Man's too garbage.
This is an interface that I write myself, let me try that.

How to use
Get
http://localhost/xb.php?msg= Content
Return
Returns the contents of a Xiaoice reply

Need to get the sub value of Weibo before use, what is a sub? Sub is the cookie that your Weibo account is logged into. And Baidu's Bduss is the same type of thing
How do I get a sub?
Open the computer version weibo.com login to your account. After successful login, open the Browser developer tool (review Element).

To view all cookies for Weibo. The value behind the sub is the sub.

Paste the sub into the following code, note that the sub is capitalized
Format: sub=
It's not over yet, open the http://weibo.com/weiruanxiaobing and follow Xiaoice Weibo.
And then send her a private message.
He will reply you to ask you to collect her, bind your mobile number, you can claim success.
After successful collection, you can use the above interface to chat,

Here's my Code.


  "$contents", ' rl ' = ' 2 ', ' uid ' = ' ' 5175429989 ', ' send ' and ' = ' sent '); Curl Analog Send Message if ($_get[msg]) {}else{echo ' your submitted content is empty!         ';     Exit     } $curl = Curl_init ();//Initialize the Curl module curl_setopt ($curl, Curlopt_url, ' http://weibo.cn/msg/do/post?st=7b1272 ');//Login submitted address curl_setopt ($curl, Curlopt_header, 0);//whether to display header information curl_setopt ($curl, Curlopt_returntransfer, 1);//Whether the returned information is automatically displayed curl    _setopt ($curl, Curlopt_cookie, SUB); curl_setopt ($curl, Curlopt_cookiejar, $cookie); Set cookie information to be saved in the specified file curl_setopt ($curl, Curlopt_post, 1);//post mode Submit curl_setopt ($curl, Curlopt_postfields, Http_bui    Ld_query ($post));//information to be submitted curl_setopt ($curl, curlopt_followlocation, 1); Curl_exec ($curl);//Perform Curl Curl_close ($curl);//Close Curl Resource and release system resources sleep (1);    Read reply $ch = Curl_init ();    curl_setopt ($ch, Curlopt_url, ' http://m.weibo.cn/msg/messages?uid=5175429989&page=1 ');    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]; Replace $m =str_replace ("Share voice", "the other party sends you a voice.")    Temporarily unable to display ", $m); $m =str_replace ("Share Picture", "the other party sent you a picture tone.")    Temporarily unable to display ", $m); Returns the result of the Echo $m;? >

localhost!!!

Local, brother, what do you want us to try? I fu le you

  • 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.