Git Product home page Git Product logo

linkedin-client's Introduction

Linkedin Client

npm version

This package allows to fetch data about individuals or companies on Linkedin.

Installation

npm i linkedin-client

Usage

You need your Linkedin cookie called "li_at". This way, requests will be sent on your behalf.
You can follow these instructions to retrieve your Linkedin session cookie.

const LinkedinClient = require('linkedin-client');

(async () => {
  const client = new LinkedinClient('YOUR_LINKEDIN_COOKIE');
  const data = await client.fetch('https://www.linkedin.com/in/williamhgates/');
  console.log(data);
})();

CLI usage

If you want to retrieve people details :

node src/cli.js https://www.linkedin.com/in/williamhgates/

Or if you want to retrieve company information :

node src/cli.js https://www.linkedin.com/company/microsoft/

Tests

npm test

Web interface

If you want to run the web interface on you own, you can do as follows :

git clone https://github.com/Cooya/Linkedin-Client.git linkedin-client
cd linkedin-client
npm install
npm run build
echo "module.exports = { cookie: 'YOUR_LINKEDIN_COOKIE' };" > config.js
npm start

Context

  • Folder src/v1 : At the very beginning, the project was a freelance mission for a client needing some leads. I used Linkedin API v1.
  • Folder src/v2 : After that I decided to design a web interface to showcase the tool. I was limited by the Linkedin API, so I somehow completed it by retrieving data with Puppeteer, a driver for an headless Google Chrome browser.
  • The Linkedin API v1 is now deprecated and the v2 is not really usable so, in this third version, there is no more use of the API and I completely skipped the use of web browser, it is a simple HTTP request and Cheerio does the job.

linkedin-client's People

Contributors

dependabot[bot] avatar ksaitor avatar lveillard avatar samjco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

linkedin-client's Issues

TypeError: LinkedinClient is not a constructor

I am using svelte for this lib and here is my code:

import { LinkedinClient } from 'linkedin-client';>>>>error here Module '"linkedin-client"' has no exported member 'LinkedinClient'.js(2305)


	async function getIt() {
		const session = supabase.auth.session();

		const tok = session?.provider_token;
		const token = JSON.stringify(tok);
		console.log(token);

		const client = new LinkedinClient(token);
		const data = await client.fetch('https://www.linkedin.com/in/erildo-shuli/');
		console.log(data);
	}

how do you import it in svelte?

npm test failed

[email protected] test /home/dell/Videos/link/Linkedin
NODE_ENV=test mocha src/tests --timeout 60000

module.js:549
throw err;
^

Error: Cannot find module '/home/dell/Videos/link/Linkedin/assets/cookies.json'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)

The above is the error where can i find cookies.json.

Rate limits / IP ?

Hey,
Great project you have going here -- much faster than my solution which was running a headless browser.
I'm curious to what extent you have used this, e.g. do you start seeing your IP blocked by LI after a few hundred requests?
-G

Skills endorsement counter

Hey @Cooya thanks for your awesome work!

I'm looking for a replacement of linkedtales/scrapedin and I saw your lib at one of the best alternatives I found!

And I started to look into your code, to add a new feature, basically add the skill endorsement counter as:

image

But when I debug into the processPeopleProfile part I can't find this number anywhere.

Can you help me about this?
Do you know if is a limitation of the way you scrap linkedin profiles? Or if you know a way to work around this, I'm really interested in help you out :D

Problème avec l'utilisation

Bonjour,
J'ai essayer de faire fonctionner Linkedin client avec npm, mais quand j’écrit: node src/cli.js https://www.linkedin.com/in/ dans le terminal mac.
Je reçois une erreur:

node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module '/Users/nom/src/cli.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

est ce que c'est le code: 'MODULE_NOT_FOUND', le problème?

Également, je veux essayer de scrape des email de Linkedin donc si ce project peux le faire sa sera vraiment super.
Merci pour ton aide.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.