Skip to content

Commit 84a318b

Browse files
authored
Script addition : LinkedIn endorsements (HarshCasper#1060)
* initial setup * scrapper.js added * pseudo code written * pseudo functions written * basic function structure added * credentials added to login to linkedin * delay added * auto scroll added * minor improvement * code cleaned and method added to get more skills * prints all skills * pseudo data and formatting added * scroll added for peoples name list * pseudo data removed * all tests done * browser made headless * comments removed * readme added * readme and cred.js added * minor changes * Updated project in the README.md
1 parent e64722a commit 84a318b

File tree

7 files changed

+1575
-1
lines changed

7 files changed

+1575
-1
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
const prompt = require("prompt-sync")()
2+
const scrapper = require("./scrapper")
3+
const chalk = require("chalk")
4+
5+
const displayEndorsements = (data) => {
6+
for (let i = 0; i < data.length; i++) {
7+
8+
console.log(`${i + 1}. ${chalk.yellow(data[i]["skill"])}`);
9+
console.log(`Endorsements: ${chalk.yellow(data[i]["number"])}`);
10+
if (data[i]["number"] != 0) {
11+
console.log(`People:`);
12+
}
13+
14+
let col = 3
15+
for (let j = 0; j < data[i]["people"].length; j += col) {
16+
let str = ``
17+
for (let k = 0; k < col && j + k < data[i]["people"].length; k++) {
18+
str += `${chalk.green(data[i]["people"][j + k])}, `
19+
}
20+
console.log(` ${chalk.green(str)}`);
21+
}
22+
23+
console.log("\n");
24+
}
25+
}
26+
27+
const init = async () => {
28+
console.log("\n===================================");
29+
console.log("---LinkedIn Endorsement scrapper---");
30+
console.log("===================================\n");
31+
32+
let profileLink = prompt("Enter LinkedIn profile link : ")
33+
34+
let endorsements = await scrapper.getEndorsements(profileLink)
35+
36+
console.log("\nThe Endorsement data is as follows:\n");
37+
displayEndorsements(endorsements)
38+
39+
console.log("\n---END---\n")
40+
}
41+
42+
// entry function
43+
init()
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# linkedin_endorsements
2+
3+
**linkedin_endorsements** is a script that scrapes LinkedIn Endorsements and see who has endorsed someone in what technologies.
4+
- It uses your emailID and password to login and scrape the data from the website.
5+
- Then prints names of people.
6+
7+
## Setup instructions
8+
9+
- Add your credentials (*i.e your emailID and Password*) in the file named `cred.js` :
10+
![File content](https://i.imgur.com/kOSMwdj.png)
11+
- Open terminal and do the following :
12+
- `cd Rotten-Scripts\JavaScript\linkedin_endorsements`
13+
- Run `npm install` to install all necessary dependencies
14+
- Run `node linkedin_endorsements.js` and Voila! you are ready to go 😉
15+
16+
## Output
17+
18+
![Output Pic](https://i.imgur.com/SzUbOhT.gif)
19+
20+
## Author(s)
21+
22+
Hi I'm [Madhav Jha](https://github.jhamadhav.com) author of this script.
23+
24+
## Disclaimer
25+
26+
- **DO NOT use the script too often (*i.e. without long intervals between searches*) as LinkedIn may block your account due to suspicious behavior**
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
"email": "Your email ID here",
3+
"password": "your password here"
4+
}

0 commit comments

Comments
 (0)