diff options
| author | jules on spawn <spawn@cortex> | 2018-04-13 17:23:32 +0200 |
|---|---|---|
| committer | jules on spawn <spawn@cortex> | 2018-04-13 17:23:32 +0200 |
| commit | 55cdfa754eea6356ef425afdd2c374886be992ad (patch) | |
| tree | 53e16241e8bca2aeeda025dc4d67856888c1aa33 | |
| parent | 48d9f2e2398014d39f818542795a4e176d5207a6 (diff) | |
render mp3 automatically and send the link to slack
| -rw-r--r-- | upload.js | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -1,5 +1,7 @@ #!`which node` +const { execFile } = require('child_process'); + require('dotenv').load(); var request = require('request') var path = require('path') @@ -32,7 +34,14 @@ var r = request.post('https://bucky.asdf.us/api/thread/' + id + '/comment', func console.log('\n') argv['_'].forEach(fn => { const partz = fn.split('/') - console.log('https://s3.amazonaws.com/i.asdf.us/bucky/data/' + id + '/' + partz[partz.length-1]); + const url = 'https://s3.amazonaws.com/i.asdf.us/bucky/data/' + id + '/' + partz[partz.length-1] + console.log(url) + const child = execFile('slack', ['chat', 'send', url, '#ai'], (error, stdout, stderr) => { + if (error) { + throw error; + } + console.log(stdout); + }); }) }) |
