Skip to content

Commit

Permalink
chore(scripts/codegen-linkedin): update codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
ythecombinator committed Jan 2, 2024
1 parent a838f04 commit b9cb4bd
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/codegen-linkedin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const DEST_PATH = 'src/content/misc/experience.json';
const API_BASE_URL = 'https://nubela.co/proxycurl/api/v2/linkedin';
const API_TOKEN = `Bearer ${process.env.NUBELA_TOKEN}`;

const SHOW_LESS_CS = '\n \n\n \n \n\n \n Zobrazit méně';

/*~
* UTILS
*/
Expand Down Expand Up @@ -45,6 +47,14 @@ function getCompanyUrl(url: string) {
return null;
}

function getDescription(rawDescription: string) {
if (rawDescription) {
return rawDescription.replace(SHOW_LESS_CS, '');
}

return null;
}

function mapExperience(experiences: ExperienceEntry[]) {
return experiences
.map((experience) => {
Expand All @@ -55,7 +65,7 @@ function mapExperience(experiences: ExperienceEntry[]) {
endDate: getEndDate(experience.ends_at),
location: experience.location,
title: experience.title,
description: experience.description,
description: getDescription(experience.description),
};
})
.filter((experience) => Boolean(experience.companyUrl));
Expand Down

0 comments on commit b9cb4bd

Please sign in to comment.