The public platform can determine based on the information sent by the user, and then give corresponding replies, with good interaction. The following describes how to simulate a simple reply function. Based on this case, developers can understand the interaction principle and perform further development.
The text information sent by the user can be extracted by using the simple if... elseif... else.
The key code is as follows:
(= "Hello" = "hello" (= "Suzhou" = "there is heaven, there is suhang" = "Thank you for your attention [Zhuo Jin Suzhou] No.: zhuojinsz"
If the user sends "hello", the user replies "hello". If the user sends "Suzhou", the user replies "there is heaven and suhang". Other information, then, reply to your welcome speech.
<? ("TOKEN", "zhuojin" =-> = ["HTTP_RAW_POST_DATA "(! (= (, 'Simplexmlelement', = (-> ("text": =-> handleText ("event": =-> handleEvent (: = "Unknow msg type :". "" handleText (=-> = (-> = ""(! (= "Text" (= "hello" = "hello" (= "Suzhou" = "there is heaven, suhang "=" thank you for choosing zhuojinsz "= (," Input something... "handleEvent (=" "(->" subscribe ": =" thank you for choosing [zhuojin Suzhou ]". "\ n ". "No.: zhuojinsz ". "\ n ". "Excellent splendid, famous city Suzhou, we provide you with Suzhou local life guide, Suzhou related information query, the best Suzhou platform. ". "\ N ". "The current platform functions are as follows :". "\ n ". "[1] check the weather. For example, enter Suzhou weather ". "\ n ". "[2] Check the public transit. For example, enter: Suzhou Public Transit 178 ". "\ n ". "[3] Translation, such as input: translation I love you ". "\ n ". "[4] Suzhou information query, such as: Suzhou guanqian Street ". "\ n ". "For more information, please wait... ": =" Unknow Event :". ->=-> responseText (, responseText (, = 0 = "" = (,-> FromUserName,-> ToUserName ,(),, = ["signature" = ["timestamp" = ["nonce" = (, (=?>
Please follow Zhuo Jin SuzhouPublic Account, Zhuo Jin SuzhouDeveloped and tested based on the SAE platform for mainstream features.
You can follow Zhuo Jin SuzhouThe public account performs function tests and obtains new application development.
1. log on to the client, and add a friend to search for the zhuojinsz number.
2. Scan the QR code:
< p>
< strong>We Believe, Great People Share Knowledge...