Last active
May 11, 2022 20:03
-
-
Save onion2k/f4133b2e82a9a1979899f7390360d880 to your computer and use it in GitHub Desktop.
Highlight HN Posts by score.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Array.from( | |
| document.querySelectorAll('span.score') | |
| ).filter( | |
| (score)=>score.innerText.match(/[2,3] points/)) | |
| .forEach( | |
| (score)=>{ | |
| [score.closest('tr'), score.closest('tr').previousSibling] | |
| .forEach((el)=>el.style.backgroundColor = '#ffd') | |
| } | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment