Skip to content

Instantly share code, notes, and snippets.

@acropup
Last active May 3, 2020 00:51
Show Gist options
  • Save acropup/b5149a528316c9adcf10ac274fca8236 to your computer and use it in GitHub Desktop.
Save acropup/b5149a528316c9adcf10ac274fca8236 to your computer and use it in GitHub Desktop.
ATIC.ca website custom filtering of products in category view
/* Category view on ATIC.ca doesn't have any means of filtering items.
This script can be run in the browser console and filters based on a product's link text.
Used on the Power Supply category: http://www.atic.ca/index.php?page=Products&cat=119
Excellent site for PSU efficiency and noise level testing:
https://www.cybenetics.com/index.php?option=database&params=1,2,0
*/
document.querySelectorAll("table table table tr td:nth-child(3) a").forEach((item) => {
let remove = false;
let linkText = item.innerText.toLowerCase();
remove |= !linkText.match(/80PLUS (Gold|Platinum|Titanium)/i);// want high efficiency
remove |= !linkText.includes("modular"); // want modular cables
let re = linkText.match(/(\d+)W Total Power/i);
remove |= (re && re.length == 2 && re[1] < 550); // want higher wattage
if (remove) {
item.closest('tr').remove();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment