User:LakesideMiners/praxunreliable.js

// Instructions available at User:Headbomb/unreliable // Feel free to request tweaks or additional sources to be covered on the talk page // Sources from Prax added by LakesideMiners. // Backlink User:Headbomb/unreliable.js // Adapted from https://en.wikipedia.org/w/index.php?title=Wikipedia:User_scripts/Requests&diff=939432100&oldid=939403363 by User:SD0001 // Updated from https://en.wikipedia.org/w/index.php?title=User:Jorm/unreliable.js&oldid=940556311 by User:Jorm // Updated from https://en.wikipedia.org/w/index.php?title=User:SD0001/unreliabe.js&oldid=941114456 by User:SD0001

// Unreliable websites based on WP:RSPSOURCES (mostly) // Unreliable publishers/journals based on WP:CITEWATCH (mostly)

// \/ regex in links doesn't work as it should, use (%2F|\/) instead $( function {

const rules = [ // Blacklisted sources

{		 regex: /\b(?:test\.prax\.org|famousbirthsdeaths\.com|arizonadailyregister\.com|healthynewage\.com|tunf\.com|newstrail\.com|ventsmagazine\.com|dailyscanner\.com|nykdaily\.com|watershapes\.com|filmdaily\.co|ritzherald\.com|voyagephoenix\.com|javamagaz\.com|thelaudablepursuit\.com|icharts\.net|themindunleashed\.com|internationalmusicmagazine\.com|paperplane\.pk|bloody-flicks\.co\.uk|enews20\.com|musictalkers\.com|digitaljournal\.com|icharts\.net|butterflylabs\.com|abc-of-snowboarding\.com|seriable\.com|opptrends\.com|thefrisky\.com|revenuesandprofits\.com|demotix\.com|dailytimes\.com\.pk|dnd\.com\.pk|oneworldherald\.com|californiaherald\.com|tricitydaily\.com|theamericanreporter\.com|londondailypost\.com|vernamagazine\.com|residentweekly\.com|openthenews\.com|healthmassive\.com|californiatimes\.us|tribunebyte\.com|allnewsbuzz\.com|apstersmedia\.com|newyorkheadlines\.us|voyagela\.com|sdvoyager\.com|exactobserver\.com|sunrisenews\.co|uaenews247\.com|filmdaily\.co|celebslifereel\.com|businessday\.ng|fabworldtoday\.com|coveragelog\.com|Healthyceleb\.com|demotix\.com|techozen\.com|articleify\.com|foreignpolicyi\.org|thefashionisto\.com|bel-india\.com|latestly\.com|thriveglobal\.com|khaleejtimes\.com|gravatar\.com|bigtimedaily\.com|gtainside\.com|empower-mag\.com|london-post\.co\.uk|isstories\.com|bestinau\.com\.au|seekerstime\.com|explosion\.com|dailymusicroll\.com|timebusinessnews\.com|sweetstartups\.com|ccdiscovery\.com|foreignpolicyi\.org|carsoid\.com|hiboox\.com|vermontrepublic\.org|empiremovies\.com|thewashingtonnote\.com|norsecorp\.com|officialroyalwedding2011\.org|bel-india\.com|comeaucomputing\.com|weirdworm\.com|earthnworld\.com|timeslifestyle\.net|atlnightspots\.com|whiteoutpress\.com|growingmagazine\.com|foreignpolicyi\.org|insiderquest247\.com|dailytimes4u\.com|morningtimestoday\.com)/, css: { "background-color": "#FF00FF" }, }

];

// Check each external link on the page against each regex $('.mw-parser-output a.external').each(function(_, link) {		$.each(rules, function(_, rule) { if (typeof rule.filter !== 'undefined' && !rule.filter) { return true; }			if (rule.regex.test(link.href)) { $(link).css(rule.css); return false; }		});	});

// Check list items against each regex to catch further reading/bibliography items without links $('.mw-parser-output ul li, .mw-parser-output ol:not(.references) li, .reference-text:not(:has(a))') .each(function(_, li) {		$.each(rules, function(_, rule) { if (typeof rule.filter !== 'undefined' && !rule.filter) { return true; }			if (rule.regex.test(li.textContent)) { $(li).css(rule.css); return false; }		});	});

} );