Skip to content

Instantly share code, notes, and snippets.

View joshuawoodward's full-sized avatar

Joshua Woodward joshuawoodward

View GitHub Profile
@joshuawoodward
joshuawoodward / zoom_webhook.php
Last active August 5, 2019 07:01
Zoom webhook RECORDING_MEETING_COMPLETED workaround
<?php
if( isset($_POST["type"]) ) {
/**
Currently the recording ready notification is not consistent with the other notifications.
The others return status, uuid, host_id, id. Recording ready returns type and content (content is a urlencoded json).
The below code will transform it into what is needed temporarly, without breaking your implemention when a fix is made, this block of code can latter be removed when the bug is fixed.
*/
if($_POST["type"] === "RECORDING_MEETING_COMPLETED"){
//In your Gruntfile
grunt.registerTask('replaceURL', '...', require('./urlReplacer.js'));
//Then in urlReplacer.js
var fs, r, oldfile, newfile;
fs = require('fs');
r = new RegExp("some regex to match your url", 'g');
//read the the file and replace the text
oldfile = fs.readFileSync(__dirname + '/file-with-url-that-needs-to-be-replaced.js', 'utf8');
newfile = oldfile.replace(r, 'http://thenewurl.com');