Skip to content

Instantly share code, notes, and snippets.

@seanlane
Created February 20, 2017 06:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seanlane/0a1a6e1b94bf7b1aa5d463983dfbe2af to your computer and use it in GitHub Desktop.
Save seanlane/0a1a6e1b94bf7b1aa5d463983dfbe2af to your computer and use it in GitHub Desktop.
Filter Domcomp.com results based on length, registration, and other factors
// Filter domcomp.com results to show what I'm interested in
function clr() {
// Google Global TLDs as of Jan 2017
var g_tlds = ['ad', 'as', 'bz', 'cc', 'cd', 'co', 'dj', 'fm', 'io',
'la', 'me', 'ms', 'nu', 'sc', 'sr', 'su', 'tv', 'tk', 'ws']
var rows = document.getElementsByClassName('price_table')[0].rows;
var re = /^[a-z0-9]+$/i;
for (var i = 1; i < rows.length; i++) {
if (rows[i].classList.contains('registered') || // Don't show registered TLDs
rows[i].attributes['tld'].value.length > 2 || // Don't show TLDs logner than 2 chars
// $.inArray(rows[i].attributes['tld'].value, g_tlds) == -1 // Only show Google Global TLDs
re.exec(rows[i].attributes['tld'].value) == null) // Don't TLDs with non-English chars
{
rows[i].style.display = 'None';
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment