-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcli_bund.js
46 lines (38 loc) · 1.35 KB
/
cli_bund.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
const got = require('got')
const ws = require('ws')
let webby = new ws('ws://1d8dab0e.ngrok.io/')
let change = `<entry name="data">
<entry name="20">${process.argv[2]}</entry>
<entry name="21">${process.argv[3]}</entry>
</entry>`
webby.on('open', () => {
console.log('Open 1')
webby.send('1 protocol peptalk noevents\n\n')
webby.send(
`2 get {117}/storage/shows/{239F365A-5671-43F3-AD44-D44EB7C4F206}/elements/100_NYHEDERNE-TEST.SOFIE.VIZ-ELEMENTER_271DB363_0/data\n\n`
)
webby.send(
`3 replace {117}/storage/shows/{239F365A-5671-43F3-AD44-D44EB7C4F206}/elements/100_NYHEDERNE-TEST.SOFIE.VIZ-ELEMENTER_271DB363_0/data {${change.length}}${change}\n\n`
)
setTimeout(() => {
got({
method: 'POST',
url: 'http://62918c05.ngrok.io/profiles/MOSART/take',
body: '/storage/shows/{239F365A-5671-43F3-AD44-D44EB7C4F206}/elements/100_NYHEDERNE-TEST.SOFIE.VIZ-ELEMENTER_271DB363_0',
})
console.log('>>> Take requested')
}, 500)
setTimeout(() => {
got({
method: 'POST',
url: 'http://62918c05.ngrok.io/profiles/MOSART/out',
body: '/storage/shows/{239F365A-5671-43F3-AD44-D44EB7C4F206}/elements/100_NYHEDERNE-TEST.SOFIE.VIZ-ELEMENTER_271DB363_0',
})
console.log('>>> Out requested')
}, 10500)
})
webby.on('upgrade', () => {
console.log('Upgrade 1')
})
webby.on('message', (m) => console.log('>>>', m))
process.on('SIGHUP', webby.close)