Skip to content

Instantly share code, notes, and snippets.

@wojcikstefan
Last active January 13, 2017 16:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wojcikstefan/97517db33265b2c2f362bd0c0cd577ae to your computer and use it in GitHub Desktop.
Save wojcikstefan/97517db33265b2c2f362bd0c0cd577ae to your computer and use it in GitHub Desktop.
Remove live call requests from Plivo's call debug logs
// Remove calls to /v1/Account/AUTH_ID/Call/?status=live from Plivo's call debug logs
// To use this code as a bookmarklet, create a bookmark with a URL equal to:
// javascript:(function(){if(typeof window.cleanPlivoDebugLogsGist !== 'undefined'){cleanPlivoDebugLogs();}else{s=document.createElement('script');s.type='text/javascript';s.src='https://rawgit.com/wojcikstefan/97517db33265b2c2f362bd0c0cd577ae/raw/b7112b1e39e9b011dd6cf0a9f631cf6b50e6624e/remove_live_calls_from_plivo_debug_logs.js';document.body.appendChild(s);}})();
window.cleanPlivoDebugLogs = function() {
$('.log-loader li').each(function(i, el) {
$(el).find('b').each(function(j, headerEl) {
var $headerEl = $(headerEl);
if ($headerEl.text().indexOf('Params') === 0) {
var nextLineText = $headerEl.parent().next().text()
if (nextLineText.trim() === 'status : live') {
$headerEl.closest('li').toggle();
}
}
});
});
};
cleanPlivoDebugLogs();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment