-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
90 lines (75 loc) · 1.89 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
const config = require('./lib/config');
var wolfram = require('./lib/wolfram');
const startchrome = require('./lib/startchrome');
//DFA states
var queryWalfram = function () {
startchrome();
//wolfram("VY9PYK-QW32V6KT55", "India Prime Minister").
// then(data => {
// console.log(`Synthesized` + data.result)
// }).
// then(() => {
// isBusy = false
// return res.sendStatus(200)
// }).
// catch(err => {
// isBusy = false
// console.error(err)
// return res.sendStatus(500)
// })
//
//response = wolfram.init(config.getAppId()).query("India Prime minister");
//console.log("Result:" + response)
//
//config.getAppId()
// .then((appId) => {
// return require('./lib/wolfram')
// .init(appId)
// .query("pi");
// })
// .then((data) => {
// console.log(data);
// })
// .then((data) => {
// console.log(data);
// })
// .done();
}
queryWalfram();
//
//var index = {
// run: (input) => {
//
// }
//};
//
//module.exports = index;
//var wolfram = require('wolfram').createClient("VY9PYK-QW32V6KT55")
//
//request = require('request')
//
//var uri = 'https://api.wolframalpha.com/v1/result?i=' + encodeURIComponent("Who is India Prime Minister") + '&appid=' + "VY9PYK-QW32V6KT55"
//
//request(uri, function (error, response, body) {
// if (!error && response.statusCode == 200) {
// console.log(body);
// }
//})
//wolfram.query("india prime minister", function (err, result) {
// if (err) throw err
// console.log("Result: %j", result)
//})
//var request = app.textRequest('Who are you?', {
// sessionId: SESSION_ID
//});
//
//request.on('response', function (response) {
// console.log(response);
// console.log(response.result.fulfillment.speech);
//});
//
//request.on('error', function (error) {
// console.log(error);
//});
//
//request.end();