somesh / Alert on New Jobs

// ==UserScript==
// @name         Alert on New Jobs
// @namespace    http://tampermonkey.net/
// @version      1.0.0
// @description  This plays a sound when there are new jobs on Upwork. Specifically, when it shows the load new jobs button
// @author       somesh
// @copyright 2018, Somesh Mukherjee (https://somesh.io)
// @match        https://www.upwork.com/ab/find-work/
// @grant        none
// @license      MIT
// @require http://code.jquery.com/jquery-1.12.4.min.js

// ==/UserScript==

(function() {
    'use strict';
    function checkPresence(){
        var loadNewButton = $(".load-newer-button");
        if(loadNewButton.length>0)
        {
            var audio = document.createElement("audio");
            audio.src = "https://actions.google.com/sounds/v1/emergency/beeper_emergency_call.ogg";
            audio.autoplay=true;
        }
    }
    window.setInterval(checkPresence, 60000)
    // Your code here...
})();