Created
February 5, 2019 06:33
-
-
Save a-stankevich/453f3f241f47eb0a913ab247e342acaa to your computer and use it in GitHub Desktop.
Highligh hackernews comments
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
// use this to filter out relevant comments in huge HN threads | |
// open a post with jobs in comments, e.g. https://news.ycombinator.com/item?id=18807017 | |
// open browser developer console (F12 or Alt-Cmd-C usually works) | |
// paste code of these functions: | |
function showComments(keywords) { | |
[].filter.call(document.getElementsByClassName('comment'), c => keywords.every(kw => c.innerText.toLowerCase().includes(kw.toLowerCase()))).forEach(c => c.classList.remove('noshow')) | |
} | |
function hideAll() { | |
[].forEach.call(document.getElementsByClassName('comment'), c => c.classList.add('noshow')) | |
} | |
function showAll() { | |
[].forEach.call(document.getElementsByClassName('comment'), c => c.classList.remove('noshow')) | |
} | |
// then use code like this to highlight comments | |
hideAll() | |
showComments(['remote', '.net']) | |
showComments(['remote', 'python']) | |
showComments(['ruby', 'javascript']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment