HN Jobs

A searchable index of Hacker News “Who is hiring?” job postings.

← All postings · June 2017 thread

kristopolous' console script (auto-parsed)

Companykristopolous' console script
Location
Salary
Apply viaSee posting
Hiring notes
TechReactNode.jsGraphQL
Posted bywjg
PostedJun 1, 2017
SourceView on Hacker News ↗

Original posting

kristopolous' console script is a godsend. But, sometimes I like to just search for keywords without filtering others out. Ctrl+f does the job but has issues such as losing my place after scrolling a bit, or not showing the searched terms anymore if I hit back after clicking a link, or not allowing for multiple keywords. The following script simply highlights the word to make it a bit easier to find. Also works well when combined with kristopolous'. The output is the number of posts matching each input string. // usage: highlight('react', 'node', 'graphql', '$') // output: [57, 29, 4, 19] function highlight(/* args */) { return Array.prototype.slice.call(arguments).map(function(keyword) { var matches = 0; Array.prototype.forEach.call(document.querySelectorAll('tr.athing.comtr div.comment'), function(e) { if (e.innerText.search(new RegExp(keyword === '$' ? '\\$' : keyword, 'i')) === -1) return; ++matches; e.innerHTML = e.innerHTML.replace(new RegExp(keyword === '$' ? '\\$' : keyword, 'ig'), '<span style="background-color:#0095ff;color:#fff;">' + keyword.toUpperCase() + '</span>') }); return matches; }) }