For excessively paranoid client authentication.
Updated Apr 5 2019:
because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.
some other notes:
(function(d) { | |
var dl = d.createElement('a'); | |
dl.innerText = 'Download MP3'; | |
dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1]; | |
dl.download = d.querySelector('em').innerText+".mp3"; | |
d.querySelector('.primary').appendChild(dl); | |
dl.style.marginLeft = '10px'; | |
dl.style.color = 'red'; | |
dl.style.fontWeight = 700; | |
})(document); |
Work in progress, I'll write this up properly when I'm done.
Almost all credit goes to @maxogden for putting me on to this and pointing me in the right direction for each of these items.
Prerequisites:
var child_process = require('child_process'); | |
exports.handler = function(event, context) { | |
var proc = spawn('./test', [ JSON.stringify(event) ], { stdio: 'inherit' }); | |
proc.on('close', function(code){ | |
if(code !== 0) { | |
return context.done(new Error("Process exited with non-zero status code")); | |
} |