Skip to content

Instantly share code, notes, and snippets.

@tylorr
Created August 28, 2015 06:12
Show Gist options
  • Save tylorr/05d03c82b75421bfbbc4 to your computer and use it in GitHub Desktop.
Save tylorr/05d03c82b75421bfbbc4 to your computer and use it in GitHub Desktop.
//Un-minified code for bookmarklet that filters orca jobs located in the bay area
(function() {
var url = 'https://orcahq.com/jobs?location=California%2C+USA&tags=Engineering';
if (decodeURIComponent(window.location.href) !== decodeURIComponent(url)) {
window.open(url);
return;
}
var cities = [
'San Francisco',
'Mountain View',
'Palo Alto',
'Redwood City',
'San Mateo',
'Menlo Park',
'Novato',
'Foster City',
'Burlingame',
'Los Gatos',
'San Rafael',
'Brisbane',
'Oakland',
'Cupertino',
'San Jose',
'Sunnyvale',
'Emeryville',
'Los Altos'
];
cities = cities.reduce(function(result, value) {
value = value.trim().toLowerCase();
result[value] = true;
return result;
}, {});
var observer = new MutationObserver(function(mutations) {
window.scrollTo(0, document.body.scrollHeight);
if ($('.loading').length == 0) {
window.scrollTo(0, 0);
$('.jobs li.job').each(function() {
var element = $(this);
var city = element.children('span').eq(2).text();
city = city.slice(0, -4).trim().toLowerCase();
if (!cities[city]) {
element.hide();
}
});
}
});
var jobList = $('.jobs')[0];
observer.observe(jobList, { childList: true });
$('.jobs .button.load').click();
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment