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
| const readline = require("readline"); | |
| const fetch = require("node-fetch"); | |
| // Create readline interface | |
| const rl = readline.createInterface({ | |
| input: process.stdin, | |
| output: process.stdout, | |
| }); | |
| // Classes for API interaction |
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
| const WebSocket = require('ws'); | |
| const readline = require('readline'); | |
| const rl = readline.createInterface({ | |
| input: process.stdin, | |
| output: process.stdout | |
| }); | |
| // All the events that can be sent to the server. |
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
| const io = require(‘socket.io-client’); | |
| const readline = require(‘readline’); | |
| const rl = readline.createInterface({ | |
| input: process.stdin, | |
| output: process.stdout | |
| }); | |
| rl.question(‘What question would you like to ask? ’, (answer) => { | |
| const socket = io(‘http://104.154.109.122:80’); | |
| const conversation = { | |
| conversation: [answer], |
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
| const io = require('socket.io-client'); | |
| const socket = io('http://0.0.0.0:8080'); | |
| const conversation = { | |
| metadata: { | |
| 'id': '1234567890', | |
| 'fingerprint': '1234567890', | |
| 'source': 'www.reddit.com', | |
| 'timestamp': '2018-01-01T00:00:00.000Z', | |
| }, |