forked from ohsusannamarie/random-LinkedIn-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bookmarklet_downloadLIRProfile_from_LIR_urls_withPubLink.txt
1 lines (1 loc) · 11.5 KB
/
bookmarklet_downloadLIRProfile_from_LIR_urls_withPubLink.txt
1
javascript:(function()%7Bvar%20reg%20%3D%20(o%2C%20n)%20%3D%3E%20o%20%3F%20o%5Bn%5D%20%3A%20''%3Bvar%20cn%20%3D%20(o%2C%20s)%20%3D%3E%20o%20%3F%20o.getElementsByClassName(s)%20%3A%20console.log(o)%3Bvar%20tn%20%3D%20(o%2C%20s)%20%3D%3E%20o%20%3F%20o.getElementsByTagName(s)%20%3A%20console.log(o)%3Bvar%20gi%20%3D%20(o%2C%20s)%20%3D%3E%20o%20%3F%20o.getElementById(s)%20%3A%20console.log(o)%3Bvar%20noHTML%20%3D%20(s)%20%3D%3E%20s.replace(%2F%3C.%2B%3F%3E%2Fg%2C%20'').replace(%2F%5Cs%2B%2Fg%2C%20'%20').replace(%2F%26.%2B%3F%3B%2Fg%2C%20'')%3Bvar%20delay%20%3D%20(ms)%20%3D%3E%20new%20Promise(res%20%3D%3E%20setTimeout(res%2C%20ms))%3Bvar%20cleanName%20%3D%20(s)%20%3D%3E%20s.replace(%2F(%3F%3C%3D%5E.%2B%3F)%5Cs%2B-%5Cs%2B.%2B%7C(%3F%3C%3D%5E.%2B%3F)%5Cs*%5BsSJj%5D%5BRr%5D.%2B%7C(%3F%3C%3D%5E.%2B%3F)%5Cs*(III%7CIV%7CII).*%7C(%3F%3C%3D%5E.%2B%3F)%5Cb%2C.*%7C(%3F%3C%3D%5E.%2B%3F)%5Cs*%5C(.*%2F%2C%20'')%3Bvar%20fixCase%20%3D%20(s)%20%3D%3E%20s.replace(%2F%5Cw%5CS*%2Fg%2C%20(txt)%20%3D%3E%20txt.charAt(0).toUpperCase()%20%2B%20txt.substr(1).toLowerCase())%3Bvar%20timer%20%3D%20new%20Date().getTime().toString().replace(%2F%5Cd%7B4%7D%24%2F%2C%20'0000')%3Bvar%20rando%20%3D%20(n)%20%3D%3E%20Math.round(Math.random()%20*%20n)%3Bvar%20fixDate%20%3D%20(s)%20%3D%3E%20s%20%3F%20s.replace(%2F%5Ba-zA-Z%5D%2B%2F%2C%20s.replace(%2F(%3F%3C%3D%5Ba-zA-Z%5D%7B3%7D).%2B%2Fg%2C%20''))%20%3A%20''%3Bvar%20now%20%3D%20new%20Date().getTime()%3Bvar%20parseDate%20%3D%20(o)%20%3D%3E%20o%20%3F%20new%20Date(o).getTime()%20%3A%20now%3Bvar%20milsec2Month%20%3D%20(n)%20%3D%3E%20Math.round(n%20%2F%202.628e%2B9)%3Bvar%20ele%20%3D%20(t)%20%3D%3E%20document.createElement(t)%3Bvar%20attr%20%3D%20(o%2C%20k%2C%20v)%20%3D%3E%20o.setAttribute(k%2C%20v)%3Bfunction%20downloadr(arr2D%2C%20filename)%20%7Bvar%20data%20%3D%20%2F%5C.json%24%7C.js%24%2F.test(filename)%20%3F%20JSON.stringify(arr2D)%20%3A%20arr2D.map(el%3D%3E%20el.reduce((a%2Cb)%20%3D%3E%20a%2B'%5Ct'%2Bb%20)).reduce((a%2Cb)%20%3D%3E%20a%2B'%5Cr'%2Bb)%3Bvar%20type%20%3D%20%2F%5C.json%24%7C.js%24%2F.test(filename)%20%3F%20'data%3Aapplication%2Fjson%3Bcharset%3Dutf-8%2C'%20%3A%20'data%3Atext%2Fplain%3Bcharset%3Dutf-8%2C'%3Bvar%20file%20%3D%20new%20Blob(%5Bdata%5D%2C%20%7B%20%20%20%20type%3A%20type%20%20%7D)%3Bif%20(window.navigator.msSaveOrOpenBlob)%20%7Bwindow.navigator.msSaveOrOpenBlob(file%2C%20filename)%3B%7D%20else%20%7Bvar%20a%20%3D%20document.createElement('a')%2Curl%20%3D%20URL.createObjectURL(file)%3Ba.href%20%3D%20url%3Ba.download%20%3D%20filename%3Bdocument.body.appendChild(a)%3Ba.click()%3BsetTimeout(()%20%3D%3E%20%7Bdocument.body.removeChild(a)%3Bwindow.URL.revokeObjectURL(url)%3B%7D%2C%2010)%3B%7D%7Dfunction%20createSearchContainer()%20%7Bif%20(gi(document%2C%20'download_cont'))%20gi(document%2C%20'download_cont').outerHTML%20%3D%20''%3Bvar%20cont%20%3D%20ele(%22div%22)%3Bdocument.body.appendChild(cont)%3Battr(cont%2C%20%22id%22%2C%20%22download_cont%22)%3Battr(cont%2C%20'style'%2C%20'position%3A%20fixed%3B%20top%3A%2020%25%3B%20left%3A%2050%25%3B%20width%3A%20360px%3B%20height%3A%20260px%3B%20background%3A%20transparent%3B%20z-index%3A%2012000%3B')%3Bvar%20head%20%3D%20ele(%22div%22)%3Battr(head%2C%20%22id%22%2C%20%22download_header%22)%3Battr(head%2C%20'style'%2C%20'background%3A%20%23004471%3B%20height%3A%209%25%3B%20border%3A%201.5px%20solid%20%23004471%3B%20border-top-right-radius%3A%200.25em%3B%20border-top-left-radius%3A%200.25em%3B%20padding%3A%200px%3B%20cursor%3A%20move%3B')%3Bcont.appendChild(head)%3Bvar%20closeBtn%20%3D%20ele(%22div%22)%3Battr(closeBtn%2C%20%22id%22%2C%20%22search_btn_close%22)%3Battr(closeBtn%2C%20'style'%2C%20'background%3A%20transparent%3B%20width%3A%2015px%3B%20height%3A%2015px%3B%20transform%3A%20scale(1.8%2C%201.2)%20translate(4px%2C%202px)%3B%20border-radius%3A%201em%3B%20padding%3A%200px%3B%20color%3A%20Crimson%3B%20cursor%3A%20pointer')%3Bhead.appendChild(closeBtn)%3BcloseBtn.innerText%20%3D%20%22X%22%3BcloseBtn.addEventListener(%22click%22%2C%20close)%3Bvar%20body%20%3D%20ele(%22div%22)%3Battr(body%2C%20%22id%22%2C%20%22download_body%22)%3Battr(body%2C%20'style'%2C%20'background%3A%20%23fff%3B%20height%3A%2090%25%3B%20border%3A%201.5px%20solid%20%23004471%3B%20border-bottom-right-radius%3A%200.25em%3B%20border-bottom-left-radius%3A%200.25em%3B%20padding%3A%206px%3B')%3Bcont.appendChild(body)%3Bvar%20dbody%20%3D%20ele(%22div%22)%3Battr(dbody%2C%20%22class%22%2C%20%22download_body_type%22)%3Battr(dbody%2C%20'style'%2C%20'background%3A%20%23fff%3B%20border-radius%3A%200.25em%3B%20padding%3A%206px%3B')%3Bbody.appendChild(dbody)%3Bvar%20hinput%20%3D%20ele(%22textarea%22)%3Battr(hinput%2C%20%22id%22%2C%20%22download_namer_text%22)%3Battr(hinput%2C%20%22placeholder%22%2C%20%22drop%20your%20LIR%20URLs%20here%20-%20should%20be%20in%20a%20column%20from%20your%20spreadsheet%22)%3Battr(hinput%2C%20'style'%2C%20'width%3A%2098%25%3B%20background%3A%20%23fff%3B%20color%3A%20%23004471%3B%20border-radius%3A%200.25em%3B%20border%3A%201px%20solid%20%23004471%3B%20padding%3A%206px%3B%20cursor%3A%20text%3B')%3Bdbody.appendChild(hinput)%3Bvar%20dlBtn%20%3D%20ele(%22div%22)%3Battr(dlBtn%2C%20%22id%22%2C%20%22downloadr_btn%22)%3Battr(dlBtn%2C%20'style'%2C%20'background%3A%20%23fff%3B%20width%3A%2094%25%3B%20color%3A%20%23004471%3B%20border%3A%201px%20solid%20%23004471%3B%20border-radius%3A%200.25em%3B%20padding%3A%206px%3B%20cursor%3A%20pointer%3B%20text-align%3A%20center%3B')%3Bdbody.appendChild(dlBtn)%3BdlBtn.innerText%20%3D%20'Run%20Script'%3BdlBtn.onclick%20%3D%20looper%3Bfunction%20close()%20%7Bdocument.body.removeChild(cont)%3B%7D%7DcreateSearchContainer()%3Basync%20function%20getFullProfileDetails(path)%20%7Bvar%20res%20%3D%20await%20fetch(%22https%3A%2F%2Fwww.linkedin.com%2Frecruiter%2Fprofile%2F%22%20%2B%20path)%3Bvar%20textBod%20%3D%20await%20res.text()%3Bvar%20jj%20%3D%20reg(%2F%5C%7B%22data%22%3A%5C%7B%22breadcrumbs%22%3A.%2B%3F%22contractId%22%3A%5Cd%2B%2C%22memberId%22%3A%5Cd%2B%5C%7D%5C%7D%5C%7D%2F.exec(textBod.replace(%2F%5Cn%7C%5Cu%7B2028%7D%2Fgu%2C%20''))%2C%200)%3Btry%20%7Bvar%20dat%20%3D%20await%20JSON.parse(jj)%3Bconsole.log(dat)%3Breturn%20dat%3B%7D%20catch%20(err)%20%7Bconsole.log(%5Berr%2C%20path%2C%20jj%5D)%3Breturn%20null%3B%7D%7Dfunction%20getTimeInJob(job)%20%7Bvar%20start%20%3D%20job%20%3F%20parseDate(job.i18nStartDate)%20%3A%20now%3Bvar%20end%20%3D%20job%20%3F%20parseDate(job.i18nEndDate)%20%3A%20now%3Bvar%20timeInJob%20%3D%20milsec2Month(end%20-%20start)%20%3F%20milsec2Month(end%20-%20start)%20%3A%200%3Breturn%20timeInJob%3B%7Dasync%20function%20looper()%20%7Bvar%20temp_v2%20%3D%20%5B%5B'Public%20Profile'%2C%20'LIR%20Profile'%2C%20'First%20Name'%2C%20'Last%20Name'%2C%20'Location'%2C%20'Current%20Employer'%2C%20'Months%20In%20Job%201'%2C%20'Current%20Title'%2C%20'Previous%20Employer'%2C%20'Months%20In%20Job%202'%2C%20'Previous%20Title'%2C%20'University%201'%2C%20'Graduation%20Date%201'%2C%20'University%202'%2C%20'Graduation%20Date%202'%2C%20'Project%20Status'%2C%20'Open%20To%20Opportunities'%2C%20'Desired%20Titles'%2C%20'Emails'%2C%20'Phones'%2C%20'Job%20App%20Ids'%2C%20'Notes'%5D%5D%3Bvar%20urls%20%3D%20gi(document%2C%20'download_namer_text').value.split(%2F%5Cn%2F).map(el%20%3D%3E%20reg(%2F(%3F%3C%3Drecruiter%5C%2Fprofile%5C%2F).%2B%3F(%3F%3D%5C%2F%7C%24)%2F.exec(el)%2C%200))%3Bfor%20(var%20i%20%3D%200%3B%20i%20%3C%20urls.length%3B%20i%2B%2B)%20%7Bgi(document%2C'downloadr_btn').innerText%20%3D%20%60downloading%20%24%7Bi%2B1%7D%20of%20%24%7Burls.length%7D%60%3Bvar%20profile%20%3D%20await%20getFullProfileDetails(urls%5Bi%5D)%3Bvar%20row%20%3D%20temp_v2.push(tocsv(profile.data.profile))%3Bawait%20delay(rando(2222))%3B%7Dgi(document%2C'downloadr_btn').innerText%20%3D%20%60download%20complete%60%3Bdownloadr(temp_v2%2C'profiles.tsv')%3B%7Dfunction%20getStatus(obj%2C%20id)%20%7Bvar%20status%20%3D%20obj.projectStatuses%3Bif%20(status)%20%7Bfor%20(var%20i%20%3D%200%3B%20i%20%3C%20status.length%3B%20i%2B%2B)%20%7Bif%20(status%5Bi%5D.projectId%20%3D%3D%20id)%20%7Breturn%20status%5Bi%5D.status.text%3B%7D%7D%7D%20else%20%7Breturn%20''%3B%7D%7Dfunction%20tocsv(obj)%20%7Bvar%20curUrl%20%3D%20window.location.href%3Bvar%20projectId%20%3D%20reg(%2F(%3F%3C%3DprojectId%3D)%5Cd%2B%2F.exec(curUrl)%2C%200)%3Bvar%20status%20%3D%20getStatus(obj%2C%20projectId)%3Bvar%20csvReady%20%3D%20(s)%20%3D%3E%20s.replace(%2F%26amp%3B%2Fg%2C%20'%26').replace(%2F%26quot%3B%2Fg%2C%20'%22')%3Bvar%20validx%20%3D%20(el)%20%3D%3E%20el%20%3F%20el%20%3A%20null%3Bvar%20seekingJob%20%3D%20obj.isJobSeeker%20%7C%7C%20obj.careerInterests%20%3F%20'yes'%20%3A%20'no'%3Bvar%20seekingTitleArr%20%3D%20obj.careerInterests%20%3F%20obj.careerInterests.interestedTitles%20%3A%20null%3Bvar%20seekingTitles%20%3D%20seekingTitleArr%20%3F%20seekingTitleArr.toString()%20%3A%20''%3Bvar%20lirPathLink%20%3D%20'https%3A%2F%2Fwww.linkedin.com%2Frecruiter%2Fprofile%2F'%20%2B%20obj.memberId%20%2B%20'%2C'%20%2B%20obj.authToken%20%2B%20'%2C'%20%2B%20obj.authType%3Bvar%20job1%20%3D%20obj.positions%20%3F%20validx(obj.positions%5B0%5D)%20%3A%20null%3Bvar%20job2%20%3D%20obj.positions%20%3F%20validx(obj.positions%5B1%5D)%20%3A%20null%3Bvar%20jobTime1%20%3D%20job1%20%3F%20getTimeInJob(job1)%20%3A%200%3Bvar%20jobTime2%20%3D%20job2%20%3F%20getTimeInJob(job2)%20%3A%200%3Bvar%20empl1%20%3D%20job1%20%3F%20noHTML(job1.companyName)%20%3A%20'%20'%3Bvar%20empl2%20%3D%20job2%20%3F%20noHTML(job2.companyName)%20%3A%20'%20'%3Bvar%20title1%20%3D%20job1%20%3F%20noHTML(job1.title)%20%3A%20'%20'%3Bvar%20title2%20%3D%20job2%20%3F%20noHTML(job2.title)%20%3A%20'%20'%3Bvar%20publink%20%3D%20obj.publicLink%3Bvar%20edu1%20%3D%20obj.educations%20%26%26%20obj.educations%5B0%5D%20%3F%20obj.educations%5B0%5D.schoolName%20%3A%20'%20'%3Bvar%20edu2%20%3D%20obj.educations%20%26%26%20obj.educations%5B1%5D%20%3F%20obj.educations%5B1%5D.schoolName%20%3A%20'%20'%3Bvar%20edu1end%20%3D%20obj.educations%20%26%26%20obj.educations%5B0%5D%20%3F%20obj.educations%5B0%5D.i18nEndDate%20%3A%20'%20'%3Bvar%20edu2end%20%3D%20obj.educations%20%26%26%20obj.educations%5B1%5D%20%3F%20obj.educations%5B1%5D.i18nEndDate%20%3A%20'%20'%3Bvar%20emailArr%20%3D%20obj.contactEmails%20%3F%20obj.contactEmails%20%3A%20%5B%5D%3Bvar%20emails%20%3D%20emailArr.length%20%3E%200%20%3F%20emailArr.map(m%20%3D%3E%20m.email).toString()%20%3A%20null%3Bvar%20phoneArr%20%3D%20obj.contactPhones%20%3F%20obj.contactPhones%20%3A%20%5B%5D%3Bvar%20phones%20%3D%20phoneArr.length%20%3E%200%20%3F%20phoneArr.map(m%20%3D%3E%20m.phone).toString()%20%3A%20null%3Bvar%20appArr%20%3D%20obj.jobApplications%20%3F%20obj.jobApplications%20%3A%20%5B%5D%3Bvar%20apps%20%3D%20appArr.length%20%3E%200%20%3F%20appArr.map(m%20%3D%3E%20m.applyStarterJobId).toString()%20%3A%20null%3Bvar%20noteArr%20%3D%20obj.notes%20%3F%20obj.notes%20%3A%20%5B%5D%3Bvar%20notes%20%3D%20noteArr.length%20%3E%200%20%3F%20noHTML(noteArr.map(m%20%3D%3E%20m.note.replace(%2F%5Cn%2Fg%2C%20'%20_%20')).toString())%20%3A%20null%3Bvar%20emailX%20%3D%20%2F%5B%5Cw%7C%5C.%5D%2B%40%5CS%2B%5C.%5Ba-zA-Z%5D%2B%2F%3Bvar%20phoneX%20%3D%20%2F((%5Cd%2B%5CW*)%5Cd*%7C)%5Cd%7B3%7D%5CW*%5Cd%7B3%7D%5CW*%5Cd%7B4%7D%2F%3Bvar%20em%20%3D%20(emailX.test(notes)%20%3D%3D%3D%20true%20%26%26%20emailX.test(emails)%20%3D%3D%3D%20false)%20%3F%20reg(emailX.exec(notes)%2C%200)%20%3A%20emails%3Bvar%20ph%20%3D%20(phoneX.test(notes)%20%3D%3D%3D%20true%20%26%26%20phoneX.test(phones)%20%3D%3D%3D%20false)%20%3F%20reg(phoneX.exec(notes)%2C%200)%20%3A%20phones%3Breturn%20%5Bpublink%2ClirPathLink%2CfixCase(obj.firstName)%2CfixCase(obj.lastName)%2CcsvReady(obj.location)%2CcsvReady(empl1)%2CjobTime1%2CcsvReady(title1)%2CcsvReady(empl2)%2CjobTime2%2CcsvReady(title2)%2CcsvReady(edu1)%2Cedu1end%2CcsvReady(edu2)%2Cedu2end%2Cstatus%2CseekingJob%2CseekingTitles%2Cem%2Cph%2Capps%2Cnotes%5D%3B%7D%7D)()