Skip to content

Instantly share code, notes, and snippets.

@vvscode
Created March 31, 2016 06:43
Show Gist options
  • Select an option

  • Save vvscode/e733c92fadfd17f2462ed490754b27d2 to your computer and use it in GitHub Desktop.

Select an option

Save vvscode/e733c92fadfd17f2462ed490754b27d2 to your computer and use it in GitHub Desktop.
Amazing Hiring parsing helper
// In global NS to make debug more easier
var PAGES_DELAY = 3000;
var profiles = [];
function step1() {
console.log(`Process page: ${window.location}`);
$('a[href*="/profile"]').toArray().forEach((a) => profiles.push(a.getAttribute('href')));
console.log(profiles.length, $('a[href*="/profile"]').length);
if(!$('a.page-link.next').length) {
return;
}
$('a.page-link.next').click();
setTimeout(step1, PAGES_DELAY);
}
function step2() {
console.log('Clear profiles links');
profiles = profiles.filter(item => item.match(/id=(.+)/)).map(item => item.match(/id=(.+)/).pop());
step3();
}
function step3() {
if(!profiles.length) {
return alert('Done');
}
var url = profiles.pop();
console.log(`Url to open: ${url}`);
window.open(url);
setTimeout(step3, Math.random()*2000 + 1000);
}
function start() {
console.clear();
console.log('Start process');
step1();
}
start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment