cor3zer0 / Call Record

// ==UserScript==
// @name          Call Record
// @namespace     https://app.hubspot.com/
// @license MIT
// @description   Will automatically record calls on HubSpot
// @include       https://app.hubspot.com/contacts/4565110/contact/*
// @require  http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
// @require  https://gist.github.com/raw/2625891/waitForKeyElements.js
// @grant    GM_addStyle
// ==/UserScript==

waitForKeyElements (
    'div.recording-icon-wrapper.status-button', clickOnCallButton
);

waitForKeyElements (
    'button.uiButton.private-button.private-button--primary.private-button--default.private-button--non-link:nth-child(1)', clickOnAgreeButton
);

function clickOnCallButton (jNode) {
    //  YOUR CODE HERE.
    // For example:
  	document.getElementsByClassName('icon-recording')[0].click();
    // alert("Working")
}

function clickOnAgreeButton (jNode) {
    // alert("AGREE")
  	document.getElementsByClassName('uiButton private-button private-button--primary private-button--default private-button--non-link')[0].click();
    // document.getElementsByClassName('uiButton private-button private-button--primary private-button--default private-button--non-link').click();
    //document.getElementsByClassName('private-button--primary').click();
}