Skip to content

Instantly share code, notes, and snippets.

@jpoles1
Created June 5, 2020 19:28
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 jpoles1/1baf984bdc1f111d40ddedbcf3ffa2a9 to your computer and use it in GitHub Desktop.
Save jpoles1/1baf984bdc1f111d40ddedbcf3ffa2a9 to your computer and use it in GitHub Desktop.
Enter this into your JS console in your web browser on the OKCupid website in order to filter matches based on locale/match percentage.
document.querySelectorAll(".usercard").forEach((cardElem) => {
let pctElem = cardElem.querySelector(".match-percentage");
let localeElem = cardElem.querySelector(".userInfo-meta-location");
//Remove matches < 85% compatibility
if(parseInt(pctElem.innerHTML.replace("%", "")) < 85) {
cardElem.style.display = "none";
}
//Filter on locale
else if(!localeElem.innerHTML.includes(", NY")) {
cardElem.style.display = "none";
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment