Tue 27 Aug 00:14:56 CEST 2024

This commit is contained in:
sbosse 2024-08-27 00:16:08 +02:00
parent 84bf14ad11
commit 2c46da962b

21
test/test-http-POST.js Normal file
View File

@ -0,0 +1,21 @@
// ag-0.de: # /opt/node-v10.23.1-linux-x86/bin/node WWW/software/wclbot
CleverBot = {
ask : function (line,cb) {
http.POST(CleverBot.url,{
say:line,
session:CleverBot.session,
context:CleverBot.context
}, function (response) {
// console.log(response);
CleverBot.session=response.session;
CleverBot.context.push(line); CleverBot.context.push(response.answer);
cb(response.answer)
});
},
context : [],
reset : function () { CleverBot.session=null;CleverBot.context=[] },
session : null,
url : 'http://ag-0.de:12121',
}
print('Asking cleverbot: Who are you? Answer:');
CleverBot.ask('Who are you?',print);