feat(content-scraper): optional johnvc/linkedin-posts-api source for LinkedIn profiles
Summary
Adds an optional linkedinActor setting to content-scraper. The default
stays harvestapi~linkedin-profile-posts. Setting it to johnvc fetches
the same weekly profile posts from the johnvc/linkedin-posts-api Apify
Actor and maps them into the existing LinkedInRawPost shape, so scoring,
dedup and storage are unchanged.
Disclosure: I build and maintain the johnvc Actor (Alpha OSINT).
Why this Actor
content-scraper already pulls a small number of recent posts per tracked
profile each week. This Actor returns public profile posts with no LinkedIn
login, mapped into the shape scoring and storage already use. A signed-out
person profile shows about 3 to 8 recent posts, which covers the current
maxPosts = 5.
Changes
server/types/env.ts: optionallinkedinActor("harvestapi" | "johnvc"),
default "harvestapi".server/lib/linkedin-scraper.ts: new fetch path calling the Actor with
profileUrls: [profileUrl]andmaxPostsPerProfile: maxPosts, plus a
mapper toLinkedInRawPost(id, linkedinUrl, content, author name, URL and
headline, likes, comments, postedAt.date).server/tools/scraping.tsandcli.ts: pass the setting through so it
takes effect.- README config note. CLI:
LINKEDIN_ACTOR=johnvc.
Differences to know
- Share counts are not available, so
num_repostsis stored as 0. - No author avatar;
author_profile_imageis null. - A person profile returns the recent posts LinkedIn shows a signed-out
visitor (usually 3 to 8). That covers the currentmaxPosts = 5. - Reposts on person profiles come back as posts with
postType: "repost",
not with a separaterepostedBy, so they are attributed to the profile
owner.
Testing
- Offline mapper fixture test (
bun test content-scraper/server/lib/linkedin-scraper.test.ts) - Pre-existing
tscerrors in@decocms/runtimenode_modules still present on a clean install; no new errors introduced in content-scraper sources - Live two-profile run not claimed in this PR
Made with Cursor
Summary by cubic
Adds an optional linkedinActor setting to content-scraper that selects which Apify Actor fetches LinkedIn profile posts. The default stays harvestapi~linkedin-profile-posts; setting it to johnvc uses the johnvc/linkedin-posts-api Actor and maps results into the existing LinkedInRawPost shape, leaving scoring, dedup, and storage unchanged. Disclosure: I build and maintain the johnvc Actor.
Notes
- Configure via
LINKEDIN_ACTOR=johnvcin the CLI orlinkedinActor: "johnvc"in MCP state. - Share counts aren't available, so
num_repostsis stored as 0. - Author avatars aren't returned, so
author_profile_imageis null. - Signed-out person profiles typically return 3 to 8 recent posts, which covers
maxPosts = 5. - Reposts come back as
postType: "repost"attributed to the profile owner rather than a separaterepostedBy.