linkedin-private-api icon indicating copy to clipboard operation
linkedin-private-api copied to clipboard

Linkedin Session

Open deividcingolani opened this issue 2 years ago • 4 comments

Hi!

deividcingolani avatar May 12 '22 13:05 deividcingolani

I've also checked the code but couldn't figure out how to fetch the previous work experience from a profile. Is it possible?

hugomn avatar May 21 '22 11:05 hugomn

any update?

deividcingolani avatar Jun 02 '22 01:06 deividcingolani

  const client = new Client();
  await client.login.userPass({ username, password });

  const profile = await client.profile.getOwnProfile();

  const result: any = await client.request.get(
    `https://www.linkedin.com/voyager/api/identity/profiles/${profile?.entityUrn.split(':')[3]}/profileView`
  );
  const aggregateResults = result?.included?.reduce(
    (acc: Record<string, any[]>, item: any) => {
      if (item.$type == 'com.linkedin.voyager.identity.profile.Position') {
        acc.positions.push(item);
      } else if (item.$type == 'com.linkedin.voyager.identity.profile.Certification') {
        acc.certifications.push(item);
      } else if (item.$type == 'com.linkedin.voyager.entities.shared.MiniSchool') {
        acc.education.push(item);
      }
      return acc;
    },
    { certifications: [], positions: [], education: [] }
  );

Not perfect but could give that a go

mjyocca avatar Jul 12 '22 00:07 mjyocca

@mjyocca Feel free to open a pull request with this change :) Can be placed here

eilonmore avatar Jul 14 '22 12:07 eilonmore