Skip to content

Instantly share code, notes, and snippets.

@Dizolivemint
Created October 14, 2016 01:31
Show Gist options
  • Save Dizolivemint/263c07b701663d108a15c3fb475d43a1 to your computer and use it in GitHub Desktop.
Save Dizolivemint/263c07b701663d108a15c3fb475d43a1 to your computer and use it in GitHub Desktop.
A Moodle Simple Broken Link Checker for Greasemonkey
// ==UserScript==
// @name Moodle Broken File Check
// @namespace elearning.pacificcollege.edu
// @description Check for Broken Files
// @version 1
// @include http://elearning.pacificcollege.edu/course/*
// @grant none
// ==/UserScript==
var links = document.links;
document.getElementById('course-header').innerHTML += "<p>The Following Links are Broken</p>"
for(var i=0; i<links.length; i++) {
if (links[i].href.indexOf('brokenfile.php') > -1) {
document.getElementById('course-header').innerHTML += "<p>" + links[i].innerHTML + "</p>";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment