Skip to content

Instantly share code, notes, and snippets.

@guarani
Last active June 3, 2016 05:41
Show Gist options
  • Save guarani/5503612c621630898dde7c862adceb76 to your computer and use it in GitHub Desktop.
Save guarani/5503612c621630898dde7c862adceb76 to your computer and use it in GitHub Desktop.
This interactive iOS Safari bookmarklet lets you search for jobs on the HN Who is Hiring thread from an iOS device.
Go to the HN Who is Hiring thread, make a bookmark, change the title to "HN Job Searcher" and replace the address with the following (paste in):
javascript:void(function(){ var a=prompt('Enter keywords:').split(' ');var c=document.getElementsByClassName('athing');var r=[];for(var i=0;i<c.length;i++){ var m=0; for(var j=0;j<a.length;j++) { if (c[i].innerText.toLowerCase().indexOf(a[j].toLowerCase()) > -1) { m++; } } if (m==a.length) { r.push(c[i])} };var z=function(x, y) { x.onclick=function(){y.scrollIntoView();}}; for(var i=0;i<r.length;i++) {r[i].style.backgroundColor='orange';z(r[i], r[i+1])};r[0].scrollIntoView();}())
Then open the bookmark as you normally would while on the thread. In the popup that appears type your job criteria, e.g. "javascript remote", and the results are shown. Tap on a result to go to the next one. Reload the page and open the bookmark again to search again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment