Created
October 14, 2017 01:22
-
-
Save MrPowerGamerBR/24a9e92842851f27d07d6a29c2b03cab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main(args: Array<String>) { | |
var sessionId = "" | |
val conversations = arrayListOf<String>("", "", "", "", "", "", "") | |
var lineRef = ""; | |
var prevref = "" | |
while (true) { | |
// println("Insira sua mensagem para o Cleverbot") | |
val stimulus = readLine() | |
// val stimulus = "Do you like Undertale?"; | |
val icognoCheck = "6fa999ff37ebaec6a5adddc5ecf96fb5" | |
val vtext8 = conversations[6] | |
val vtext7 = conversations[5] | |
val vtext6 = conversations[4] | |
val vtext5 = conversations[3] | |
val vtext4 = conversations[2] | |
val vtext3 = conversations[1] | |
val vtext2 = conversations[0] | |
val body = HttpRequest.post("http://app.cleverbot.com/webservicexml_ais_AYA") | |
.userAgent("Dalvik/2.1.0 (Linux; U; Android 7.0.0; MotoG3-TE Build/NJH47F)") | |
.send(String.format("stimulus=%s&sessionid=%s&vtext8=%s&vtext7=%s&vtext6=%s&vtext5=%s&vtext4=%s&vtext3=%s&vtext2=%s&prevref=%s&lineRef=%s&icognoCheck=$icognoCheck&icognoID=cleverandroid", | |
URLEncoder.encode(stimulus, "UTF-8"), | |
URLEncoder.encode(sessionId, "UTF-8"), | |
URLEncoder.encode(vtext8, "UTF-8"), | |
URLEncoder.encode(vtext7, "UTF-8"), | |
URLEncoder.encode(vtext6, "UTF-8"), | |
URLEncoder.encode(vtext5, "UTF-8"), | |
URLEncoder.encode(vtext4, "UTF-8"), | |
URLEncoder.encode(vtext3, "UTF-8"), | |
URLEncoder.encode(vtext2, "UTF-8"), | |
URLEncoder.encode(prevref, "UTF-8"), | |
URLEncoder.encode(lineRef, "UTF-8") | |
)) | |
.body() | |
val xmlJSONObj = jsonParser.parse(XML.toJSONObject(body).toString()) | |
val session = xmlJSONObj["webservicexml"]["session"] | |
val response = session["response"].string | |
val lineRef = session["lineRef"].int | |
val prevref = session["prevref"].int | |
sessionId = session["sessionid"].string | |
println("> ${response}") | |
conversations.removeAt(conversations.size - 1) | |
conversations.add(response) | |
} | |
} |
o power é mito
oi baleia
tudo bem com vc????? ;)))))
Seria um sonho ou o seebotschat voltar ou isso acabar virando um novo seebotschat <3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
lol