diff --git a/eslint.config.js b/eslint.config.js index fc716bc..141196e 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -18,6 +18,7 @@ export default [ ecmaVersion: "latest", globals: { ...globals.browser, + ...globals.node, }, "parserOptions": { "sourceType": "module", diff --git a/linkedIn/main.js b/linkedIn/main.js index 0a4105d..297ef08 100644 --- a/linkedIn/main.js +++ b/linkedIn/main.js @@ -1,13 +1,13 @@ /** * 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 = /SideRamp|DataAnnotation|Veeva Systems|Aha!|HireMeFast|Team Remotely|Recruiting from Scratch|myGwork|Jerry|RemoteWorker|ClickJobs\.io/i; +const MatchRegex = /Viewed|Applied/; +const CompaniesRegex = /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 = 4; +const HoursToCheck = undefined; setInterval(removeJobs, 100); diff --git a/removeFileNameGuid.js b/removeFileNameGuid.js index 9ad7b91..e505326 100644 --- a/removeFileNameGuid.js +++ b/removeFileNameGuid.js @@ -1,14 +1,16 @@ import fs from "fs"; +import path from "path"; -let [pathToDir] = process.argv.slice(2); -const GuidRegex = /_[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}|\[Explicit\]/ig; +const [pathToDir] = process.argv.slice(2); +const GuidRegex = /_[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}|\[Explicit\]|\s+$/ig; if (!pathToDir) { throw Error("Please specify the path!"); } -pathToDir = pathToDir.replace("\"", ""); -fs.readdirSync(pathToDir).forEach((file) => { - if (GuidRegex.test(file)) { - file = `${pathToDir}\\${file}`; - fs.renameSync(file, file.replace(GuidRegex, "")); +// If we're in Windows, and we feed a path like "Z:\Blah\"... the backslash at the end will attempt to escape the quote incorrectly +process.chdir(pathToDir.replace(/"$/, "")); +fs.readdirSync(".").forEach((file) => { + const { name, ext } = path.parse(file); + if (GuidRegex.test(name)) { + fs.renameSync(file, name.replace(GuidRegex, "") + ext); } });