Board Thread:Script Suggestions/@comment-1824272-20170809084206/@comment-27958705-20170810021834

function compare(a,b) { if (a.c > b.c)       return -1; if (a.c < b.c)       return 1; return 0; }; var a=new mw.Api, c=0; console.log('get redirects'); a.get({action: 'query', list: 'allpages', apfilterredir: 'redirects', aplimit:'500'}) .done(function(data){ console.log(data);  var ap=data.query.allpages; bls=[]; console.log('processing backlinks');   $.each(ap, function(i,v){ var a=new mw.Api; c++; a.get({action:'query', list: 'backlinks', bltitle: v.title, blcount: '1', bllimit: '5000'}) .done(function(data){       console.log('bl', i, v.title, data);        c--;        bls.push({t: v.title, c: data.query.backlinks_count});        if(c===0){            console.log('sorting backlinks');            bls.sort(compare);            console.log('bls',bls);            $.each(bls, function(i,v){ console.log(i, 'title:', v.t, 'count:', v.c); if(i>100 && v.c===0) return false; }); //each bls       }}); //if c===0 (all backlinks done) }); //backlink done }); //done allpages pasted into console (f11 or whatever) it will get 500 redirects, then get links to them, sort it descending order and write 1st hundred into console in format: "#, title, link count".

note: redirects will returned in arbitrary order. also, script will write currently processed backlinks in format "bl # title data" - it is not what u need, it's just to ensure script is running.