@chrisdothtml/job-scraper 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +71 -0
  3. package/dist/cache.d.ts +64 -0
  4. package/dist/cache.d.ts.map +1 -0
  5. package/dist/cache.js +146 -0
  6. package/dist/cache.js.map +1 -0
  7. package/dist/companies.d.ts +89 -0
  8. package/dist/companies.d.ts.map +1 -0
  9. package/dist/companies.js +244 -0
  10. package/dist/companies.js.map +1 -0
  11. package/dist/companies.seed.d.ts +9 -0
  12. package/dist/companies.seed.d.ts.map +1 -0
  13. package/dist/companies.seed.js +455 -0
  14. package/dist/companies.seed.js.map +1 -0
  15. package/dist/constants.d.ts +8 -0
  16. package/dist/constants.d.ts.map +1 -0
  17. package/dist/constants.js +14 -0
  18. package/dist/constants.js.map +1 -0
  19. package/dist/index.d.ts +46 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +69 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/paths.d.ts +16 -0
  24. package/dist/paths.d.ts.map +1 -0
  25. package/dist/paths.js +17 -0
  26. package/dist/paths.js.map +1 -0
  27. package/dist/platform/browser.d.ts +3 -0
  28. package/dist/platform/browser.d.ts.map +1 -0
  29. package/dist/platform/browser.js +103 -0
  30. package/dist/platform/browser.js.map +1 -0
  31. package/dist/platform/node.d.ts +3 -0
  32. package/dist/platform/node.d.ts.map +1 -0
  33. package/dist/platform/node.js +106 -0
  34. package/dist/platform/node.js.map +1 -0
  35. package/dist/platform/types.d.ts +46 -0
  36. package/dist/platform/types.d.ts.map +1 -0
  37. package/dist/platform/types.js +2 -0
  38. package/dist/platform/types.js.map +1 -0
  39. package/dist/resolve.d.ts +89 -0
  40. package/dist/resolve.d.ts.map +1 -0
  41. package/dist/resolve.js +379 -0
  42. package/dist/resolve.js.map +1 -0
  43. package/dist/scrapers/AshbyScraper.d.ts +16 -0
  44. package/dist/scrapers/AshbyScraper.d.ts.map +1 -0
  45. package/dist/scrapers/AshbyScraper.js +207 -0
  46. package/dist/scrapers/AshbyScraper.js.map +1 -0
  47. package/dist/scrapers/GitHubScraper.d.ts +8 -0
  48. package/dist/scrapers/GitHubScraper.d.ts.map +1 -0
  49. package/dist/scrapers/GitHubScraper.js +61 -0
  50. package/dist/scrapers/GitHubScraper.js.map +1 -0
  51. package/dist/scrapers/GoogleScraper.d.ts +8 -0
  52. package/dist/scrapers/GoogleScraper.d.ts.map +1 -0
  53. package/dist/scrapers/GoogleScraper.js +83 -0
  54. package/dist/scrapers/GoogleScraper.js.map +1 -0
  55. package/dist/scrapers/GreenhouseScraper.d.ts +28 -0
  56. package/dist/scrapers/GreenhouseScraper.d.ts.map +1 -0
  57. package/dist/scrapers/GreenhouseScraper.js +68 -0
  58. package/dist/scrapers/GreenhouseScraper.js.map +1 -0
  59. package/dist/scrapers/LeverScraper.d.ts +13 -0
  60. package/dist/scrapers/LeverScraper.d.ts.map +1 -0
  61. package/dist/scrapers/LeverScraper.js +58 -0
  62. package/dist/scrapers/LeverScraper.js.map +1 -0
  63. package/dist/scrapers/NetflixScraper.d.ts +8 -0
  64. package/dist/scrapers/NetflixScraper.d.ts.map +1 -0
  65. package/dist/scrapers/NetflixScraper.js +60 -0
  66. package/dist/scrapers/NetflixScraper.js.map +1 -0
  67. package/dist/scrapers/NvidiaScraper.d.ts +8 -0
  68. package/dist/scrapers/NvidiaScraper.d.ts.map +1 -0
  69. package/dist/scrapers/NvidiaScraper.js +61 -0
  70. package/dist/scrapers/NvidiaScraper.js.map +1 -0
  71. package/dist/scrapers/RipplingScraper.d.ts +10 -0
  72. package/dist/scrapers/RipplingScraper.d.ts.map +1 -0
  73. package/dist/scrapers/RipplingScraper.js +64 -0
  74. package/dist/scrapers/RipplingScraper.js.map +1 -0
  75. package/dist/scrapers/Scraper.d.ts +134 -0
  76. package/dist/scrapers/Scraper.d.ts.map +1 -0
  77. package/dist/scrapers/Scraper.js +224 -0
  78. package/dist/scrapers/Scraper.js.map +1 -0
  79. package/dist/scrapers/ShopifyScraper.d.ts +16 -0
  80. package/dist/scrapers/ShopifyScraper.d.ts.map +1 -0
  81. package/dist/scrapers/ShopifyScraper.js +104 -0
  82. package/dist/scrapers/ShopifyScraper.js.map +1 -0
  83. package/dist/scrapers/SmartRecruitersScraper.d.ts +13 -0
  84. package/dist/scrapers/SmartRecruitersScraper.d.ts.map +1 -0
  85. package/dist/scrapers/SmartRecruitersScraper.js +66 -0
  86. package/dist/scrapers/SmartRecruitersScraper.js.map +1 -0
  87. package/dist/scrapers/UberScraper.d.ts +14 -0
  88. package/dist/scrapers/UberScraper.d.ts.map +1 -0
  89. package/dist/scrapers/UberScraper.js +94 -0
  90. package/dist/scrapers/UberScraper.js.map +1 -0
  91. package/dist/scrapers/WorkableScraper.d.ts +12 -0
  92. package/dist/scrapers/WorkableScraper.d.ts.map +1 -0
  93. package/dist/scrapers/WorkableScraper.js +67 -0
  94. package/dist/scrapers/WorkableScraper.js.map +1 -0
  95. package/dist/scrapers/WorkdayScraper.d.ts +14 -0
  96. package/dist/scrapers/WorkdayScraper.d.ts.map +1 -0
  97. package/dist/scrapers/WorkdayScraper.js +85 -0
  98. package/dist/scrapers/WorkdayScraper.js.map +1 -0
  99. package/dist/scrapers/index.d.ts +41 -0
  100. package/dist/scrapers/index.d.ts.map +1 -0
  101. package/dist/scrapers/index.js +46 -0
  102. package/dist/scrapers/index.js.map +1 -0
  103. package/dist/search.d.ts +75 -0
  104. package/dist/search.d.ts.map +1 -0
  105. package/dist/search.js +225 -0
  106. package/dist/search.js.map +1 -0
  107. package/dist/sniff.d.ts +43 -0
  108. package/dist/sniff.d.ts.map +1 -0
  109. package/dist/sniff.js +124 -0
  110. package/dist/sniff.js.map +1 -0
  111. package/dist/utils/misc.d.ts +15 -0
  112. package/dist/utils/misc.d.ts.map +1 -0
  113. package/dist/utils/misc.js +31 -0
  114. package/dist/utils/misc.js.map +1 -0
  115. package/package.json +70 -0
@@ -0,0 +1,94 @@
1
+ import { cachedFetch } from "../cache.js";
2
+ import { time } from "../utils/misc.js";
3
+ import { JobNotFoundError, Scraper, } from "./Scraper.js";
4
+ // Uber's public careers site (jobs.uber.com) is a Next.js frontend over
5
+ // Oracle Fusion Recruiting Cloud, whose REST API is reachable directly with
6
+ // no auth or cookies, but the pod host and site number are Uber-specific
7
+ // and can't be derived from anything else, so this scraper stays bespoke.
8
+ const ORACLE_HOST = 'iaziqy.fa.ocs.oraclecloud.com';
9
+ const SITE_NUMBER = 'CX_1';
10
+ const PAGE_SIZE = 200;
11
+ function jobLocation(job) {
12
+ const locations = [
13
+ job.PrimaryLocation,
14
+ ...(job.secondaryLocations ?? []).map((l) => l.Name),
15
+ ].filter((l) => Boolean(l));
16
+ return [...new Set(locations)].join(', ');
17
+ }
18
+ export default class UberScraper extends Scraper {
19
+ static parseUrl(url) {
20
+ if (url.hostname !== 'jobs.uber.com')
21
+ return null;
22
+ const match = url.pathname.match(/^\/[a-z]{2}\/jobs\/([^/]+)\/?$/);
23
+ if (!match || !match[1])
24
+ return { slug: 'uber', jobId: null };
25
+ return { slug: 'uber', jobId: match[1] };
26
+ }
27
+ jobUrl(id) {
28
+ return `https://jobs.uber.com/en/jobs/${id}/`;
29
+ }
30
+ /**
31
+ * The per-job detail endpoint doesn't include the location, so we cache
32
+ * the listing fields when we have them (from `getJobsList`) and attach
33
+ * them to the individual job when it's fetched.
34
+ */
35
+ jobsById = new Map();
36
+ async getJobsList(testing = false) {
37
+ const jobs = [];
38
+ let offset = 0;
39
+ let total = Infinity;
40
+ while (offset < total) {
41
+ const url = new URL(`https://${ORACLE_HOST}/hcmRestApi/resources/latest/recruitingCEJobRequisitions`);
42
+ url.searchParams.set('onlyData', 'true');
43
+ url.searchParams.set('expand', 'requisitionList.secondaryLocations');
44
+ url.searchParams.set('finder', `findReqs;siteNumber=${SITE_NUMBER},limit=${testing ? 1 : PAGE_SIZE},offset=${offset},sortBy=POSTING_DATES_DESC`);
45
+ const res = (await cachedFetch
46
+ .call({ cache: !testing, cacheTTL: time.day }, url.toString(), {
47
+ headers: { Accept: 'application/json' },
48
+ })
49
+ .then((res) => res.json()));
50
+ const result = res.items[0];
51
+ total = result?.TotalJobsCount ?? 0;
52
+ for (const job of result?.requisitionList ?? []) {
53
+ const listedJob = {
54
+ id: job.Id,
55
+ title: job.Title,
56
+ location: jobLocation(job),
57
+ url: this.jobUrl(job.Id),
58
+ };
59
+ this.jobsById.set(listedJob.id, listedJob);
60
+ jobs.push(listedJob);
61
+ }
62
+ if (testing)
63
+ break;
64
+ offset += PAGE_SIZE;
65
+ }
66
+ return jobs;
67
+ }
68
+ async getJobContent(id) {
69
+ const url = new URL(`https://${ORACLE_HOST}/hcmRestApi/resources/latest/recruitingCEJobRequisitionDetails`);
70
+ url.searchParams.set('expand', 'all');
71
+ url.searchParams.set('finder', `ById;Id="${id}",siteNumber=${SITE_NUMBER}`);
72
+ const res = (await cachedFetch(url.toString(), {
73
+ headers: { Accept: 'application/json' },
74
+ }).then((res) => res.json()));
75
+ const job = res.items[0];
76
+ if (!job)
77
+ throw new JobNotFoundError(id, this.companySlug);
78
+ // the detail endpoint doesn't include location, so pull it from the
79
+ // listing cache when we have it; a job can still have detail after
80
+ // falling off the active list, so this is best-effort, not required
81
+ if (this.jobsById.size === 0)
82
+ await this.getJobsList();
83
+ const listedJob = this.jobsById.get(id);
84
+ return JSON.stringify({
85
+ ...job,
86
+ ...(listedJob && {
87
+ title: listedJob.title,
88
+ location: listedJob.location,
89
+ url: listedJob.url,
90
+ }),
91
+ });
92
+ }
93
+ }
94
+ //# sourceMappingURL=UberScraper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UberScraper.js","sourceRoot":"","sources":["../../src/scrapers/UberScraper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,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,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAExC,OAAO,IAAI,CAAC,SAAS,CAAC;YACpB,GAAG,GAAG;YACN,GAAG,CAAC,SAAS,IAAI;gBACf,KAAK,EAAE,SAAS,CAAC,KAAK;gBACtB,QAAQ,EAAE,SAAS,CAAC,QAAQ;gBAC5B,GAAG,EAAE,SAAS,CAAC,GAAG;aACnB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ import { Scraper, type ListedJob, type ParsedUrl } from './Scraper.ts';
2
+ export default class WorkableScraper extends Scraper {
3
+ private baseUrl;
4
+ static readonly discoverable = true;
5
+ static readonly boardDomains: string[];
6
+ static parseUrl(url: URL): ParsedUrl | null;
7
+ jobUrl(id: string): string;
8
+ constructor(...args: ConstructorParameters<typeof Scraper>);
9
+ getJobsList(testing?: boolean): Promise<ListedJob[]>;
10
+ getJobContent(id: string): Promise<string>;
11
+ }
12
+ //# sourceMappingURL=WorkableScraper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkableScraper.d.ts","sourceRoot":"","sources":["../../src/scrapers/WorkableScraper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAyBvE,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,OAAO;IAClD,OAAO,CAAC,OAAO,CAAS;IAExB,MAAM,CAAC,QAAQ,CAAC,YAAY,QAAQ;IACpC,MAAM,CAAC,QAAQ,CAAC,YAAY,WAA0B;IAEtD,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,SAAS,GAAG,IAAI;IAW3C,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;gBAId,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,OAAO,CAAC;IAKpD,WAAW,CAAC,OAAO,UAAQ,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IA6BlD,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAgBjD"}
@@ -0,0 +1,67 @@
1
+ import { cachedFetch } from "../cache.js";
2
+ import { time } from "../utils/misc.js";
3
+ import { Scraper } from "./Scraper.js";
4
+ function formatLocation(loc) {
5
+ return [loc.city, loc.region, loc.country].filter(Boolean).join(', ');
6
+ }
7
+ export default class WorkableScraper extends Scraper {
8
+ baseUrl;
9
+ static discoverable = true;
10
+ static boardDomains = ['apply.workable.com'];
11
+ static parseUrl(url) {
12
+ if (url.hostname !== 'apply.workable.com')
13
+ return null;
14
+ const [slug, j, id] = url.pathname.split('/').filter(Boolean);
15
+ // `/j/{id}` is a short link that names the posting but not the account,
16
+ // so there's no board to resolve
17
+ if (!slug || slug === 'j')
18
+ return null;
19
+ return { slug, jobId: j === 'j' ? (id ?? null) : null };
20
+ }
21
+ jobUrl(id) {
22
+ return `https://apply.workable.com/${this.companySlug}/j/${id}/`;
23
+ }
24
+ constructor(...args) {
25
+ super(...args);
26
+ this.baseUrl = `https://apply.workable.com/api/v3/accounts/${this.companySlug}`;
27
+ }
28
+ async getJobsList(testing = false) {
29
+ const res = (await cachedFetch
30
+ .call({ cache: !testing, cacheTTL: time.day }, `${this.baseUrl}/jobs`, {
31
+ method: 'POST',
32
+ headers: { 'Content-Type': 'application/json' },
33
+ body: JSON.stringify({
34
+ query: '',
35
+ department: [],
36
+ location: [],
37
+ workplace: [],
38
+ worktype: [],
39
+ }),
40
+ })
41
+ .then((r) => r.json()));
42
+ return res.results.map((job) => {
43
+ const locations = [job.location, ...job.locations]
44
+ .map(formatLocation)
45
+ .filter(Boolean);
46
+ return {
47
+ id: job.shortcode,
48
+ url: `https://apply.workable.com/${this.companySlug}/j/${job.shortcode}/`,
49
+ title: job.title,
50
+ location: [...new Set(locations)].join(', ') || 'Remote',
51
+ };
52
+ });
53
+ }
54
+ async getJobContent(id) {
55
+ const res = (await cachedFetch(`https://apply.workable.com/api/v2/accounts/${this.companySlug}/jobs/${id}`).then((res) => res.json()));
56
+ // `location`/`locations` are structured objects here, not the plain
57
+ // string `readListingFields` looks for
58
+ const locations = [res.location, ...(res.locations ?? [])]
59
+ .map(formatLocation)
60
+ .filter(Boolean);
61
+ return JSON.stringify({
62
+ ...res,
63
+ location: [...new Set(locations)].join(', ') || 'Remote',
64
+ });
65
+ }
66
+ }
67
+ //# sourceMappingURL=WorkableScraper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkableScraper.js","sourceRoot":"","sources":["../../src/scrapers/WorkableScraper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAkC,MAAM,cAAc,CAAC;AAqBvE,SAAS,cAAc,CAAC,GAAqB;IAC3C,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxE,CAAC;AAED,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,OAAO;IAC1C,OAAO,CAAS;IAExB,MAAM,CAAU,YAAY,GAAG,IAAI,CAAC;IACpC,MAAM,CAAU,YAAY,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAEtD,MAAM,CAAC,QAAQ,CAAC,GAAQ;QACtB,IAAI,GAAG,CAAC,QAAQ,KAAK,oBAAoB;YAAE,OAAO,IAAI,CAAC;QAEvD,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC9D,wEAAwE;QACxE,iCAAiC;QACjC,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,GAAG;Y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AEnB,OAAO;gBACL,EAAE,EAAE,GAAG,CAAC,SAAS;gBACjB,GAAG,EAAE,8BAA8B,IAAI,CAAC,WAAW,MAAM,GAAG,CAAC,SAAS,GAAG;gBACzE,KAAK,EAAE,GAAG,CAAC,KAAK;gBAChB,QAAQ,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,QAAQ;aACzD,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,EAAU;QAC5B,MAAM,GAAG,GAAG,CAAC,MAAM,WAAW,CAC5B,8CAA8C,IAAI,CAAC,WAAW,SAAS,EAAE,EAAE,CAC5E,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAsB,CAAC;QAElD,oEAAoE;QACpE,uCAAuC;QACvC,MAAM,SAAS,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;aACvD,GAAG,CAAC,cAAc,CAAC;aACnB,MAAM,CAAC,OAAO,CAAC,CAAC;QAEnB,OAAO,IAAI,CAAC,SAAS,CAAC;YACpB,GAAG,GAAG;YACN,QAAQ,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,QAAQ;SACzD,CAAC,CAAC;IACL,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { Scraper, type ListedJob, type ParsedUrl } from './Scraper.ts';
2
+ export default class WorkdayScraper extends Scraper {
3
+ private baseUrl;
4
+ /** The base url format used when deeplinking to a job */
5
+ private deeplinkUrl;
6
+ private siteUrl;
7
+ static readonly boardDomains: string[];
8
+ static parseUrl(url: URL): ParsedUrl | null;
9
+ constructor(...args: ConstructorParameters<typeof Scraper>);
10
+ jobUrl(id: string): string;
11
+ getJobsList(testing?: boolean): Promise<ListedJob[]>;
12
+ getJobContent(id: string): Promise<string>;
13
+ }
14
+ //# sourceMappingURL=WorkdayScraper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkdayScraper.d.ts","sourceRoot":"","sources":["../../src/scrapers/WorkdayScraper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAoBvE,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;IACjD,OAAO,CAAC,OAAO,CAAS;IACxB,yDAAyD;IACzD,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,OAAO,CAAS;IAGxB,MAAM,CAAC,QAAQ,CAAC,YAAY,WAAyB;IAErD,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,SAAS,GAAG,IAAI;gBAgB/B,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,OAAO,CAAC;IAQ1D,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAIpB,WAAW,CAAC,OAAO,UAAQ,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAsClD,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAoBjD"}
@@ -0,0 +1,85 @@
1
+ import { cachedFetch } from "../cache.js";
2
+ import { time } from "../utils/misc.js";
3
+ import { Scraper } from "./Scraper.js";
4
+ const PAGE_SIZE = 20;
5
+ // Workday tenants are split across pods (e.g. wd1, wd5) and each posts jobs
6
+ // under a site slug (e.g. "Ext", "careers") that varies per company and
7
+ // can't be derived from the tenant name, so the companySlug in companies.ts
8
+ // must be the dot-joined `tenant.pod.site`, e.g. "autodesk.wd1.Ext".
9
+ export default class WorkdayScraper extends Scraper {
10
+ baseUrl;
11
+ /** The base url format used when deeplinking to a job */
12
+ deeplinkUrl;
13
+ siteUrl;
14
+ // a Workday URL is `https://{tenant}.{pod}.myworkdayjobs.com/[locale/]{site}{externalPath}`
15
+ static boardDomains = ['myworkdayjobs.com'];
16
+ static parseUrl(url) {
17
+ const host = url.hostname.match(/^([^.]+)\.([^.]+)\.myworkdayjobs\.com$/);
18
+ if (!host)
19
+ return null;
20
+ const [, tenant, pod] = host;
21
+ const segments = url.pathname.split('/').filter(Boolean);
22
+ // some tenants prefix the site with a locale segment
23
+ if (/^[a-z]{2}-[A-Z]{2}$/.test(segments[0] ?? ''))
24
+ segments.shift();
25
+ const site = segments.shift();
26
+ if (!site)
27
+ return null;
28
+ const externalPath = segments.length > 0 ? '/' + segments.join('/') : null;
29
+ return { slug: `${tenant}.${pod}.${site}`, jobId: externalPath };
30
+ }
31
+ constructor(...args) {
32
+ super(...args);
33
+ const [tenant, pod, site] = this.companySlug.split('.');
34
+ this.siteUrl = `https://${tenant}.${pod}.myworkdayjobs.com`;
35
+ this.deeplinkUrl = `${this.siteUrl}/${site}`;
36
+ this.baseUrl = `${this.siteUrl}/wday/cxs/${tenant}/${site}`;
37
+ }
38
+ jobUrl(id) {
39
+ return `${this.deeplinkUrl}${id}`;
40
+ }
41
+ async getJobsList(testing = false) {
42
+ const jobs = [];
43
+ let offset = 0;
44
+ let total = Infinity;
45
+ while (offset < total) {
46
+ const res = (await cachedFetch
47
+ .call({ cache: !testing, cacheTTL: time.day }, `${this.baseUrl}/jobs`, {
48
+ method: 'POST',
49
+ headers: { 'Content-Type': 'application/json' },
50
+ body: JSON.stringify({
51
+ appliedFacets: {},
52
+ limit: PAGE_SIZE,
53
+ offset,
54
+ searchText: '',
55
+ }),
56
+ })
57
+ .then((res) => res.json()));
58
+ total = res.total;
59
+ jobs.push(...res.jobPostings.map((job) => ({
60
+ id: job.externalPath,
61
+ url: `${this.deeplinkUrl}${job.externalPath}`,
62
+ title: job.title,
63
+ // some tenants omit `locationsText`; the last bullet field is
64
+ // consistently the most specific location in that case
65
+ location: job.locationsText ?? job.bulletFields?.at(-1) ?? '',
66
+ })));
67
+ if (testing)
68
+ break;
69
+ offset += PAGE_SIZE;
70
+ }
71
+ return jobs;
72
+ }
73
+ async getJobContent(id) {
74
+ const res = (await cachedFetch(`${this.baseUrl}${id}`).then((res) => res.json()));
75
+ const info = res.jobPostingInfo;
76
+ // title/location live nested under `jobPostingInfo` here, not at the
77
+ // top level `readListingFields` looks for
78
+ return JSON.stringify({
79
+ ...res,
80
+ title: info.title,
81
+ location: [info.location, ...(info.additionalLocations ?? [])].join(', '),
82
+ });
83
+ }
84
+ }
85
+ //# sourceMappingURL=WorkdayScraper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkdayScraper.js","sourceRoot":"","sources":["../../src/scrapers/WorkdayScraper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAkC,MAAM,cAAc,CAAC;AAcvE,MAAM,SAAS,GAAG,EAAE,CAAC;AAErB,4EAA4E;AAC5E,wEAAwE;AACxE,4EAA4E;AAC5E,qEAAqE;AACrE,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;IACzC,OAAO,CAAS;IACxB,yDAAyD;IACjD,WAAW,CAAS;IACpB,OAAO,CAAS;IAExB,4FAA4F;IAC5F,MAAM,CAAU,YAAY,GAAG,CAAC,mBAAmB,CAAC,CAAC;IAErD,MAAM,CAAC,QAAQ,CAAC,GAAQ;QACtB,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC1E,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QAEvB,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;QAC7B,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,C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C,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAClE,GAAG,CAAC,IAAI,EAAE,CACX,CAMA,CAAC;QACF,MAAM,IAAI,GAAG,GAAG,CAAC,cAAc,CAAC;QAEhC,qEAAqE;QACrE,0CAA0C;QAC1C,OAAO,IAAI,CAAC,SAAS,CAAC;YACpB,GAAG,GAAG;YACN,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,QAAQ,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,CAAC,mBAAmB,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;SAC1E,CAAC,CAAC;IACL,CAAC"}
@@ -0,0 +1,41 @@
1
+ import AshbyScraper from './AshbyScraper.ts';
2
+ import GitHubScraper from './GitHubScraper.ts';
3
+ import GoogleScraper from './GoogleScraper.ts';
4
+ import GreenhouseScraper from './GreenhouseScraper.ts';
5
+ import LeverScraper from './LeverScraper.ts';
6
+ import NetflixScraper from './NetflixScraper.ts';
7
+ import NvidiaScraper from './NvidiaScraper.ts';
8
+ import RipplingScraper from './RipplingScraper.ts';
9
+ import { type ScraperSubclass } from './Scraper.ts';
10
+ import ShopifyScraper from './ShopifyScraper.ts';
11
+ import SmartRecruitersScraper from './SmartRecruitersScraper.ts';
12
+ import UberScraper from './UberScraper.ts';
13
+ import WorkableScraper from './WorkableScraper.ts';
14
+ import WorkdayScraper from './WorkdayScraper.ts';
15
+ /**
16
+ * Every scraper this package ships. Ordered by how widely the board is used,
17
+ * which is the order company discovery probes them in.
18
+ */
19
+ export declare const scrapers: {
20
+ GreenhouseScraper: typeof GreenhouseScraper;
21
+ AshbyScraper: typeof AshbyScraper;
22
+ LeverScraper: typeof LeverScraper;
23
+ WorkableScraper: typeof WorkableScraper;
24
+ SmartRecruitersScraper: typeof SmartRecruitersScraper;
25
+ RipplingScraper: typeof RipplingScraper;
26
+ WorkdayScraper: typeof WorkdayScraper;
27
+ GitHubScraper: typeof GitHubScraper;
28
+ GoogleScraper: typeof GoogleScraper;
29
+ NetflixScraper: typeof NetflixScraper;
30
+ NvidiaScraper: typeof NvidiaScraper;
31
+ ShopifyScraper: typeof ShopifyScraper;
32
+ UberScraper: typeof UberScraper;
33
+ };
34
+ export type ScraperName = keyof typeof scrapers;
35
+ export declare const scraperNames: ScraperName[];
36
+ export declare function isScraperName(name: string): name is ScraperName;
37
+ export declare function getScraper(name: string): ScraperSubclass;
38
+ /** The scrapers whose board slugs can be guessed from a company name */
39
+ export declare const discoverableScrapers: ("GreenhouseScraper" | "AshbyScraper" | "LeverScraper" | "WorkableScraper" | "SmartRecruitersScraper" | "RipplingScraper" | "WorkdayScraper" | "GitHubScraper" | "GoogleScraper" | "NetflixScraper" | "NvidiaScraper" | "ShopifyScraper" | "UberScraper")[];
40
+ export { Scraper, type Job, type ListedJob, type ParsedUrl, type ScraperSubclass, } from './Scraper.ts';
41
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scrapers/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,cAAc,MAAM,qBAAqB,CAAC;AACjD,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,eAAe,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,cAAc,MAAM,qBAAqB,CAAC;AACjD,OAAO,sBAAsB,MAAM,6BAA6B,CAAC;AACjE,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,eAAe,MAAM,sBAAsB,CAAC;AACnD,OAAO,cAAc,MAAM,qBAAqB,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;CAcsB,CAAC;AAE5C,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,QAAQ,CAAC;AAEhD,eAAO,MAAM,YAAY,EAA4B,WAAW,EAAE,CAAC;AAEnE,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,WAAW,CAE/D;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAGxD;AAED,wEAAwE;AACxE,eAAO,MAAM,oBAAoB,6PAEhC,CAAC;AAEF,OAAO,EACL,OAAO,EACP,KAAK,GAAG,EACR,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,eAAe,GACrB,MAAM,cAAc,CAAC"}
@@ -0,0 +1,46 @@
1
+ import AshbyScraper from "./AshbyScraper.js";
2
+ import GitHubScraper from "./GitHubScraper.js";
3
+ import GoogleScraper from "./GoogleScraper.js";
4
+ import GreenhouseScraper from "./GreenhouseScraper.js";
5
+ import LeverScraper from "./LeverScraper.js";
6
+ import NetflixScraper from "./NetflixScraper.js";
7
+ import NvidiaScraper from "./NvidiaScraper.js";
8
+ import RipplingScraper from "./RipplingScraper.js";
9
+ import {} from "./Scraper.js";
10
+ import ShopifyScraper from "./ShopifyScraper.js";
11
+ import SmartRecruitersScraper from "./SmartRecruitersScraper.js";
12
+ import UberScraper from "./UberScraper.js";
13
+ import WorkableScraper from "./WorkableScraper.js";
14
+ import WorkdayScraper from "./WorkdayScraper.js";
15
+ /**
16
+ * Every scraper this package ships. Ordered by how widely the board is used,
17
+ * which is the order company discovery probes them in.
18
+ */
19
+ export const scrapers = {
20
+ GreenhouseScraper,
21
+ AshbyScraper,
22
+ LeverScraper,
23
+ WorkableScraper,
24
+ SmartRecruitersScraper,
25
+ RipplingScraper,
26
+ WorkdayScraper,
27
+ GitHubScraper,
28
+ GoogleScraper,
29
+ NetflixScraper,
30
+ NvidiaScraper,
31
+ ShopifyScraper,
32
+ UberScraper,
33
+ };
34
+ export const scraperNames = Object.keys(scrapers);
35
+ export function isScraperName(name) {
36
+ return Object.hasOwn(scrapers, name);
37
+ }
38
+ export function getScraper(name) {
39
+ if (!isScraperName(name))
40
+ throw new Error(`Unknown scraper: ${name}`);
41
+ return scrapers[name];
42
+ }
43
+ /** The scrapers whose board slugs can be guessed from a company name */
44
+ export const discoverableScrapers = scraperNames.filter((name) => scrapers[name].discoverable);
45
+ export { Scraper, } from "./Scraper.js";
46
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scrapers/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,cAAc,MAAM,qBAAqB,CAAC;AACjD,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,eAAe,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAwB,MAAM,cAAc,CAAC;AACpD,OAAO,cAAc,MAAM,qBAAqB,CAAC;AACjD,OAAO,sBAAsB,MAAM,6BAA6B,CAAC;AACjE,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,eAAe,MAAM,sBAAsB,CAAC;AACnD,OAAO,cAAc,MAAM,qBAAqB,CAAC;AAEjD;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,iBAAiB;IACjB,YAAY;IACZ,YAAY;IACZ,eAAe;IACf,sBAAsB;IACtB,eAAe;IACf,cAAc;IACd,aAAa;IACb,aAAa;IACb,cAAc;IACd,aAAa;IACb,cAAc;IACd,WAAW;CAC8B,CAAC;AAI5C,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAkB,CAAC;AAEnE,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC;IACtE,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC;AAED,wEAAwE;AACxE,MAAM,CAAC,MAAM,oBAAoB,GAAG,YAAY,CAAC,MAAM,CACrD,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,YAAY,CACtC,CAAC;AAEF,OAAO,EACL,OAAO,GAKR,MAAM,cAAc,CAAC"}
@@ -0,0 +1,75 @@
1
+ import { type ScraperName } from './scrapers/index.ts';
2
+ import { type ParsedUrl } from './scrapers/Scraper.ts';
3
+ export interface SearchConfig {
4
+ /**
5
+ * SerpApi key. Defaults to `SERP_API_TOKEN` in the environment, then
6
+ * `SERPAPI_KEY` / `SERPAPI_API_KEY`. Browsers have no environment, so
7
+ * there search stays off until a key is passed to `configureSearch`.
8
+ */
9
+ apiKey: string | null;
10
+ /**
11
+ * Most searches to spend per `period`. SerpApi's free tier is 250 searches
12
+ * a month, which is the default; check your own dashboard, since the
13
+ * allowance changes. Set `period: 'day'` if your plan is metered daily.
14
+ */
15
+ limit: number;
16
+ period: 'day' | 'month';
17
+ /** Results to ask for per search */
18
+ resultCount: number;
19
+ /**
20
+ * How long a search result, including a fruitless one, is reused before
21
+ * the company is worth spending another search on. Companies change job
22
+ * boards rarely, and this is the difference between paying once per
23
+ * company and paying once per lookup.
24
+ */
25
+ resultTtl: number;
26
+ /**
27
+ * Companies per query when searching in bulk. Names are OR'd together and
28
+ * results attributed back by slug, so this many companies cost one search.
29
+ */
30
+ batchSize: number;
31
+ }
32
+ /**
33
+ * Overrides the search settings for this process. Anything left out keeps
34
+ * falling back to the environment, then to the defaults above. Passing
35
+ * `undefined` for a key drops the override, restoring that fallback.
36
+ *
37
+ * @example
38
+ * configureSearch({ apiKey: 'abc123', limit: 5, period: 'day' });
39
+ */
40
+ export declare function configureSearch(config: Partial<SearchConfig>): void;
41
+ export declare function getSearchConfig(): SearchConfig;
42
+ /** Whether a web search is configured and has quota left */
43
+ export declare function canSearch(): Promise<boolean>;
44
+ export interface SearchedBoard extends ParsedUrl {
45
+ scraper: ScraperName;
46
+ /** The search result this came from */
47
+ url: string;
48
+ }
49
+ /**
50
+ * Asks a web search which job board a company posts on, by scoping the query
51
+ * to the domains our scrapers serve. This is the fallback for companies
52
+ * whose board slug can't be guessed from their name, and the only way to
53
+ * find a Workday tenant, since those slugs aren't derivable at all.
54
+ *
55
+ * Returns an empty array when search isn't configured, is out of quota, or
56
+ * turns up nothing. It never throws for those reasons; callers treat search
57
+ * as an optional accelerator.
58
+ */
59
+ export declare function searchForBoards(companyName: string): Promise<SearchedBoard[]>;
60
+ export interface BatchedSearch {
61
+ companyName: string;
62
+ boards: SearchedBoard[];
63
+ }
64
+ /**
65
+ * Looks up several companies at once. Their names are OR'd into a single
66
+ * query and the results attributed back by slug, so `batchSize` companies
67
+ * cost one search instead of one each.
68
+ *
69
+ * Anything already cached is answered without a query, and only the
70
+ * remainder is batched, so re-running a large list is nearly free.
71
+ */
72
+ export declare function searchForBoardsBatch(companyNames: string[]): Promise<BatchedSearch[]>;
73
+ /** Forgets remembered search results. Returns how many companies were dropped */
74
+ export declare function clearSearchCache(): Promise<number>;
75
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AAGA,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,KAAK,SAAS,EAAE,M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