fixed some issues with searchEmployees

This commit is contained in:
2024-05-14 08:08:24 -07:00
parent ae600c4544
commit 9a34197fc8
4 changed files with 31 additions and 20 deletions
+20 -6
View File
@@ -1,15 +1,29 @@
import LinkedInAPIClass from "../index.js";
import fs from 'fs';
(async () => {
const LAPI = new LinkedInAPIClass(true);
const LAPI = new LinkedInAPIClass(true);
const o = JSON.parse(fs.readFileSync('config.json'));
await LAPI.login(o.email, o.password);
const o = JSON.parse(fs.readFileSync('config.json'));
await LAPI.login(o.email, o.password);
async function smallTest() {
const c = (await LAPI.searchCompanies('microsoft', [5001], 20, 0, true, true)).find(o => (o.name === 'Microsoft'));
console.log(c);
const managers = await c.searchEmployees('manager', 20);
console.log(managers, managers.length);
}
async function largeTest() {
const c = (await LAPI.searchCompanies('marukai', null, 1, 0, true, true)).find(o => (o.name === 'Marukai Corporation U.S.A.'));
console.log(c);
console.log(await c.getEmployees());
const managers = await c.searchEmployees('manager');
console.log(managers, managers.length);
})();
}
largeTest();