From b9cb4bd3a31d6583f221961727e0fa5b262075c4 Mon Sep 17 00:00:00 2001 From: Matheus Albuquerque Date: Tue, 2 Jan 2024 14:42:19 +0100 Subject: [PATCH] chore(scripts/codegen-linkedin): update codegen --- scripts/codegen-linkedin.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/codegen-linkedin.ts b/scripts/codegen-linkedin.ts index 1d55760..513f28b 100644 --- a/scripts/codegen-linkedin.ts +++ b/scripts/codegen-linkedin.ts @@ -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 */ @@ -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) => { @@ -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));