Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const Pusher = require('pusher')
const secrets = require('./secrets')
const Encryptor = require('simple-encryptor')
const R = require('ramda')
const encrypt = R.curry((secret, data) => Encryptor(secret).encrypt(data))
const encryptWithSecret = encrypt(secrets.e2eSecret)
const trigger = R.curry((secrets, channel, event, message) => {
const client = new Pusher({
appId: secrets.appId,
key: secrets.key,
secret: secrets.secret,
cluster: 'eu'
})
client.trigger(
channel,
event,
message
)
})
const triggerRequestScene = trigger(secrets, 'obs-remote-updates', 'request-scene')
const triggerRequestSceneEncrypted = R.pipe(encryptWithSecret, triggerRequestScene)
const triggerRequestSceneEncrypted = R.compose(triggerRequestScene, encryptWithSecret)
const triggerRequestSceneEncrypted = sceneName => triggerRequestScene(encryptWithSecret(sceneName))
const triggerDeskScene = () => triggerRequestSceneEncrypted('left desk only')
const triggerCodingScene = () => triggerRequestSceneEncrypted('Remote Coding')
//triggerDeskScene()
triggerCodingScene()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.