-
Notifications
You must be signed in to change notification settings - Fork 503
Expand file tree
/
Copy pathLinkedIn_Endorsements.js
More file actions
43 lines (33 loc) · 1.25 KB
/
LinkedIn_Endorsements.js
File metadata and controls
43 lines (33 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const prompt = require("prompt-sync")()
const scrapper = require("./scrapper")
const chalk = require("chalk")
const displayEndorsements = (data) => {
for (let i = 0; i < data.length; i++) {
console.log(`${i + 1}. ${chalk.yellow(data[i]["skill"])}`);
console.log(`Endorsements: ${chalk.yellow(data[i]["number"])}`);
if (data[i]["number"] != 0) {
console.log(`People:`);
}
let col = 3
for (let j = 0; j < data[i]["people"].length; j += col) {
let str = ``
for (let k = 0; k < col && j + k < data[i]["people"].length; k++) {
str += `${chalk.green(data[i]["people"][j + k])}, `
}
console.log(` ${chalk.green(str)}`);
}
console.log("\n");
}
}
const init = async () => {
console.log("\n===================================");
console.log("---LinkedIn Endorsement scrapper---");
console.log("===================================\n");
let profileLink = prompt("Enter LinkedIn profile link : ")
let endorsements = await scrapper.getEndorsements(profileLink)
console.log("\nThe Endorsement data is as follows:\n");
displayEndorsements(endorsements)
console.log("\n---END---\n")
}
// entry function
init()