Created
April 18, 2015 18:05
-
-
Save connorshea/be37963116b0f06d4b1d to your computer and use it in GitHub Desktop.
Find broken links in a wiki page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function findBrokenLinks() { | |
var newlinks = $("a.new").get(); | |
console.log(newlinks); | |
var testarray = []; | |
for ( var i = 0; i < newlinks.length; i++ ) { | |
testarray.push( newlinks[ i ].innerHTML ); | |
} | |
console.log(testarray); | |
testarray.sort(); | |
var testvariable = ""; | |
for ( var i = 0; i < testarray.length; i++ ) { | |
testvariable = testvariable + "* [[" + testarray[i] + "]]" + "\n"; | |
} | |
console.log(testvariable); | |
} | |
var ready = function() { | |
findBrokenLinks(); | |
}; | |
$(document).ready(ready); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment