Call a powerful AI robot

Source: Internet
Author: User

Recently learned from friends that such a free platform is said to be the most intelligent robot in Chinese language context. have been using the platform to get a chat robot to play. The code from the Turing machine Person official website Access document, is an API port call way, can call the Turing machine person, uses in the development website customer service, the third party platform, the QQ robot and so on, this API's access and the use is free, and does not limit the frequency, only then to the Turing Machine Person official website registration activates. Please don't call me Lei Feng!

PHP code

$apiKey = "own Appkey";  $apiURL = "Http://www.tuling123.com/openapi/api?key=KEY&info=INFO"; Set up the message header to construct the request packet header ("content-type:text/html; Charset=utf-8 ");  $reqInfo = "Tell a joke";  $url = Str_replace ("INFO", $reqInfo, Str_replace ("KEY", $apiKey, $apiURL)); /** method One, use file_get_contents to get the contents of the content *       /$res =file_get_contents ($url);       Echo $res; /** method Two, using the Curl Library, you need to see if PHP.ini has already opened the Curl extension *      /$ch = Curl_init ();      $timeout = 5; curl_setopt ($ch, Curlopt_url, $url); curl_setopt ($ch, Curlopt_returntransfer, 1);      curl_setopt ($ch, Curlopt_connecttimeout, $timeout);      $file _contents = curl_exec ($ch);      Curl_close ($ch);      

Call a powerful AI robot

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.