User:Polygnotus/Scripts/XC.js: Difference between revisions

Content deleted Content added
error handling and caching
redlinked userpages
Line 52:
// Find all user links in signatures
function findUserLinks() {
// Find linksboth toregular user pageslinks thatand aren'tredlinks, insideexcluding the "talk" part of signaturespages
const links = $('#content a[href^="/wiki/User:"]:not([href*="talk"]):not([data-ec-checked]), ' +
// and only within the main content area
const links = $( '#content a[href^="/wikiw/index.php?title=User:"]:not([href*="talk"]):not([data-ec-checked])');
console.log('Found user links:', links.length);
links.each((_, link) => console.log('User link:', $(link).text(), $(link).attr('href')));
Line 63:
function getUsernameFromLink(link) {
const href = $(link).attr('href');
returnconst match = href.replacematch('/wiki/User:', ''([^/?&]+)/);
return match ? match[1] : null;
}