Skip to content

Instantly share code, notes, and snippets.

@lmchawla
Last active May 30, 2018 09:22
Show Gist options
  • Save lmchawla/7ff5ca67f06125010f8715f5b75dd197 to your computer and use it in GitHub Desktop.
Save lmchawla/7ff5ca67f06125010f8715f5b75dd197 to your computer and use it in GitHub Desktop.
var load=true;
var fill=true;
function match_profile(text,type){
if(!type){
var arrayString = 'cto|Tech Co Founder|VP';}
if(type==1){arrayString='lead|head|cofounder|co-founder|vp|president|director|manager|chief|data|analyst|senior'}
if(type==2){arrayString='python|node|technical|technology|software|engineering'}
return text.match(new RegExp("\\b(" + arrayString + ")\\b",'i'));
}
var template = "I would like to apply for Tech Lead role in your organization, \n I love your mission statement and I believe that I match the requirements. \nI have worked in multiple startups from planning, to product development. Hiring and leading teams. Raising rounds and completing successful exits and so I believe I will be a right fit for this role. \nMost recently, I worked extensively in analytics dashboards to optimise military decisions in BSF(border security force) and NSG(national security guards) \nI am attaching my resume for your reference \nhttps://goo.gl/6LfA8s \nMy contact number is 9899696089, would love to talk for job prospects or just for mutual-knowledge-sharing\n"
function scrape(){
var jobs=$('.browse_startups_table_row');
var ctr=0;
for(var i =0;i<jobs.length;i++){
var job=$(jobs[i]);
var titles=job.find('.top>.title').text()+job.find('.listing-row>.tags').text();
var match=match_profile(titles)||(match_profile(titles,1)&&match_profile(titles,2));
if(match){
ctr++;
console.log(job.data('name'),match[0]);
writeMessage(job);
}
else{if(i<jobs.length-5) job.remove();}
writeMessage(job);
}
console.log(ctr+'/'+jobs.length)
focus_to_first();
}
function show_more()
{
if(!load)return;
var scroll = $(window).scrollTop();
$("body, html").animate({
scrollTop: $(document).height()
}, 0);
focus_to_first();
}
function fetch_more(){
len=$('.browse_startups_table_row').length;
if(len<10)
show_more();
}
function writeMessage(job){
if(!fill)return;
if(!job.hasClass('expanded')) {job.click();
job.find('.add-note-button').click();
var textArea=job.find('.interested-note')[0];
var str=textArea.getAttribute('placeholder')
var placeText=str.split('note to ').pop().split(' at').shift()+'/'+str.split(' at ').pop().split('. What ').shift();
$(textArea).text("Hello "+placeText+" team,\n"+template);}
}
function focus_to_first(){
var texts=$('textarea');
for(var i =0;i<texts.length;i++){
if($($('textarea')[i]).is(':visible')){$('textarea')[i].focus(); return;} }
}
window.setInterval(scrape,1000);
window.setInterval(show_more,90000);
window.setInterval(fetch_more,1000);
window.setInterval(function(){$('.talent_save_filter_cta').remove()},1000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment