Skip to content

Commit

Permalink
- Updating LinkedIn script to include Indeed
Browse files Browse the repository at this point in the history
- Fixing issue with LI changing their class names
  • Loading branch information
incutonez committed Dec 18, 2024
1 parent 21dc379 commit 7d5b676
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
21 changes: 20 additions & 1 deletion linkedIn/details2.js
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
navigator.clipboard.writeText(`${document.getElementsByClassName('job-details-jobs-unified-top-card__company-name')[0].getElementsByClassName('app-aware-link ')[0].innerText};${document.getElementsByClassName('t-24 t-bold inline')[0].innerText};${new Intl.DateTimeFormat('en-US').format(new Date())};${location.href.split('?')[0]}`);
let companyName;
let jobTitle;
let url;
let appliedDate = new Intl.DateTimeFormat('en-US', {
day: '2-digit',
month: '2-digit',
year: 'numeric'
}).format(new Date());
if (location.hostname === "www.indeed.com") {
companyName = document.querySelector('.jobsearch-JobInfoHeader-companyNameLink')?.innerText || document.querySelector(".jobsearch-JobInfoHeader-companyNameSimple").innerText;
jobTitle = document.querySelector("[data-testid='simpler-jobTitle']").innerText;
url = location.toString();
}
else {
const parent = document.getElementsByClassName('job-details-jobs-unified-top-card__company-name')[0];
companyName = parent.getElementsByTagName("a")[0]?.innerText || parent.innerText;
jobTitle = document.getElementsByClassName('t-24 t-bold inline')[0].innerText;
url = location.href.split('?')[0];
}
navigator.clipboard.writeText(`${companyName};${jobTitle};${appliedDate};${url}`);
13 changes: 7 additions & 6 deletions linkedIn/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,36 @@
* In order to use this, go to about:debugging#/runtime/this-firefox and load the manifest.json file as the Temporary Add-on
*/
const MatchRegex = /Viewed|Applied|Promoted/;
const CompaniesRegex = /Novum Global|Pragmatike|Energy Jobline|JTek Software Solutions|Software Technology Inc|Get It Recruit|Actalent|Patterned Learning|G2i|SideRamp|DataAnnotation|Veeva Systems|Aha!|HireMeFast|Team Remotely|Recruiting from Scratch|myGwork|Jerry|RemoteWorker|ClickJobs\.io|Varsity Tutors|Ascendion/i;
const CompaniesRegex = /Childhood Cancer Society|Mobius Ventures|Breezy Talent|Find Next Hire|Timely Find|Finding Candidate|Jobs via Dice|Geico|Novum Global|Pragmatike|Energy Jobline|JTek Software Solutions|Software Technology Inc|Get It|Actalent|Patterned Learning|G2i|SideRamp|DataAnnotation|Veeva Systems|Aha!|HireMeFast|Team Remotely|Recruiting from Scratch|myGwork|Jerry|RemoteWorker|ClickJobs\.io|Varsity Tutors|Ascendion/i;
const Today = new Date();
const OneWeek = 604800000;
const HoursAgoRegex = /(\d+) hours ago/;
const MinutesAgoRegex = /minutes ago/;
const HoursToCheck = undefined;
const cardClass = ".ember-view.scaffold-layout__list-item";

setInterval(removeJobs, 100);

function removeJobs() {
document.querySelectorAll(".job-card-container__footer-item").forEach((el) => {
if (el.innerHTML.match(MatchRegex)) {
el.closest(".jobs-search-results__list-item").remove();
el.closest(cardClass).remove();
}
});
document.querySelectorAll(".job-card-container__primary-description").forEach((el) => {
document.querySelectorAll(".artdeco-entity-lockup__subtitle").forEach((el) => {
if (el.innerHTML.match(CompaniesRegex)) {
el.closest(".jobs-search-results__list-item").remove();
el.closest(cardClass).remove();
}
});
document.querySelectorAll(".job-card-container__footer-item time").forEach((el) => {
const text = el.innerText;
if (Today - new Date(el.getAttribute("datetime")) > OneWeek) {
el.closest(".jobs-search-results__list-item").remove();
el.closest(cardClass).remove();
}
else if (HoursToCheck && !MinutesAgoRegex.test(text)) {
const match = text?.match(HoursAgoRegex)?.[1];
if (!match || +match > HoursToCheck) {
el.closest(".jobs-search-results__list-item").remove();
el.closest(cardClass).remove();
}
}
});
Expand Down

0 comments on commit 7d5b676

Please sign in to comment.