updated README

This commit is contained in:
2024-05-31 15:53:17 -04:00
parent 97ec9c9f87
commit ef7d0c3e05
2 changed files with 33 additions and 0 deletions
+2
View File
@@ -25,6 +25,8 @@ const comp = await LAPI.searchCompanies("Linux");
const emp = await comp[0].getEmployees("Torvalds", 1);
```
For more information, check out [The Wiki](https://github.com/ION606/linkedin-api/wiki/home)
## Contributions
If you want to contribute, just fork, add your features, then make a PR
+31
View File
@@ -273,6 +273,37 @@ export default class linkedInAPIClass {
return r.data;
}
async startTyping(memberURN, originURN) {
await this.evade();
const rPath = 'https://www.linkedin.com/voyager/api/voyagerMessagingDashMessengerConversations?action=typing',
body = { "conversationUrn": `urn:li:msg_conversation:(urn:li:fsd_profile:${originURN},2-${memberURN})` };
await axios.post(rPath, body, { headers: this.headers });
return r.data;
}
async sendMessage(memberURN, originURN, msg) {
await this.startTyping(memberURN, originURN);
await this.evade();
const headers = this.headers;
headers['X-li-page-instance'] = 'urn:li:page:d_flagship3_people;Bcu9vSv6TBe4uT46jDAZuw==';
const rPath = 'https://www.linkedin.com/voyager/api/voyagerMessagingDashMessengerMessages?action=createMessage',
body = {
"message": {
"body": {
"attributes": [],
"text": msg
}, "originToken": "b7df876c-c072-4ef1-9aee-ef84895347d9", "renderContentUnions": []
}, "mailboxUrn": `urn:li:fsd_profile:${memberURN}`, "dedupeByClientGeneratedToken": false, "hostRecipientUrns": [`urn:li:fsd_profile:${originURN}`]
}
const r = await axios.post(rPath, body, { headers: this.headers });
return r.data;
}
/**
* @returns {Promise<LinkedInProfile[]>}
* @param {String} keyword the user to search for