agronauts / LEARN course remover

// ==UserScript==
// @name         LEARN course remover
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Simplify Learn courses
// @author       You
// @match        http://learn.canterbury.ac.nz/
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    
    //Delete menu items
    document.getElementsByClassName('block_menu_site_and_course')[0].remove();
    document.getElementsByClassName('block_site_main_menu')[0].remove();
    
    //Delete  courses, identified by title attribute in the <a> node (Use 'Inspect' tool to find this easily)
    var titles = ['COSC420S1', 'COSC261S1', 'SENG302', 'SENG401', 'COSC428S1']; // TODO Can't get the following to work: 'CSSE PG', 'CSSE Notices', 'Engineering Work Experience'];
    titles.forEach( function(title) {
        var query = '[title="' + title + '"]';
        var node = document.querySelector(query);
        node.parentNode.parentNode.remove(); // Delete containing <li>
    });
    
})();