mirror of
https://github.com/ION606/linkedin-api.git
synced 2026-05-14 22:06:54 +00:00
fixed an incrementor bug
This commit is contained in:
+2
-2
@@ -209,13 +209,13 @@ export default class linkedInAPIClass {
|
|||||||
let urlExt = `variables=(start:${i},origin:GLOBAL_SEARCH_HEADER,query:(keywords:${keyword},flagshipSearchIntent:SEARCH_SRP,queryParameters:List((key:resultType,value:List(COMPANIES))${(numEmp) ? `,(key:companySize,value:List(${numsToSizes(...numEmp)}))` : ''}),includeFiltersInResponse:false))`;
|
let urlExt = `variables=(start:${i},origin:GLOBAL_SEARCH_HEADER,query:(keywords:${keyword},flagshipSearchIntent:SEARCH_SRP,queryParameters:List((key:resultType,value:List(COMPANIES))${(numEmp) ? `,(key:companySize,value:List(${numsToSizes(...numEmp)}))` : ''}),includeFiltersInResponse:false))`;
|
||||||
const r = await this._makeReq(urlExt);
|
const r = await this._makeReq(urlExt);
|
||||||
|
|
||||||
if (this.logAll) lb.increment();
|
|
||||||
|
|
||||||
if (!r?.included && r?.data?.errors) {
|
if (!r?.included && r?.data?.errors) {
|
||||||
console.error(JSON.stringify(r.data.errors))
|
console.error(JSON.stringify(r.data.errors))
|
||||||
throw "ERROR!";
|
throw "ERROR!";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.logAll) lb.increment(Math.ceil(r.included.length / 10));
|
||||||
|
|
||||||
if (!castToClass) compAll.push(r);
|
if (!castToClass) compAll.push(r);
|
||||||
else compAll.push(await parseResponse(r, this, excludeGeneric));
|
else compAll.push(await parseResponse(r, this, excludeGeneric));
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -48,7 +48,7 @@ export class LoadingBar {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
increment(amt) {
|
increment(amt = 1) {
|
||||||
cursorTo(process.stdout, this.cursor);
|
cursorTo(process.stdout, this.cursor);
|
||||||
for (let i = 0; i < amt; i++) process.stdout.write("\u2588");
|
for (let i = 0; i < amt; i++) process.stdout.write("\u2588");
|
||||||
this.cursor += amt;
|
this.cursor += amt;
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@
|
|||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"name": "linkedin-api-js",
|
"name": "linkedin-api-js",
|
||||||
"version": "1.0.0-15",
|
"version": "1.0.0-16",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
|||||||
Reference in New Issue
Block a user