Raw Source
NelsonTheSantos / PowerPanel Ticket Checker

// ==UserScript==
// @name         PowerPanel Ticket Checker
// @version      1.5
// @description  Checks for # of open PowerPanel tickets by parsing AccountDetails, something that should be added to PP anyway.
// @author       NelsonS
// @match        https://secure1.inmotionhosting.com/admin/note/*
// @license      MIT
// @updateURL    https://gitlab.imh-support.com/nelsons/scripts/raw/master/PowerPanel_Ticket_Checker.user.js
// @downloadURL  https://gitlab.imh-support.com/nelsons/scripts/raw/master/PowerPanel_Ticket_Checker.user.js
// ==/UserScript==

$(document).ready(function(){
    var idReg = /.*\/admin\/note\/id\/(\d+)$/;
    var accountID = document.URL.match(idReg)[1];

    var regOpen = /<b>OPEN<\/b>/g;
    $.get( "https://secure1.inmotionhosting.com/admin/accountdetail/id/"+accountID, function( data ) {
        var openTickets = data.match(regOpen);
        $('#customerInfo').children().first().append((openTickets) ? "<b>Open Tickets: "+openTickets.length+"</b>" : "No Open Tickets");
    });
});