Skip to content

feat: add LinkedIn as a fifth platform - #3

Open
nicogiesen wants to merge 1 commit into
bradautomates:mainfrom
nicogiesen:feat/linkedin-platform
Open

nicogiesen wants to merge 1 commit into
bradautomates:mainfrom
nicogiesen:feat/linkedin-platform

Conversation

@nicogiesen

Copy link
Copy Markdown

What

Adds LinkedIn as a fifth platform, using the ScrapeCreators LinkedIn endpoints that already ship with the same API key.

Why

LinkedIn is the primary channel for a lot of B2B founders and consultants running this skill — and ScrapeCreators already exposes everything needed (person profile incl. recentPosts, post details with engagement + comments, post transcript). The FILE-SCHEMAS even name linkedin.md as an example, so the data model was ready for it.

How

The one quirk: /v1/linkedin/profile returns recentPosts without dates or engagement. fetch_profile therefore chains a /v1/linkedin/post lookup per recent post (capped at 8, so a profile fetch costs at most 1 + 8 credits). Posts whose enrichment fails are kept with preview text and empty engagement instead of being dropped. This cost behavior is documented in the README next to the existing X quirk.

  • lib/linkedin.pyfetch_profile (profile → per-post enrichment chain), fetch_post, fetch_comments (from the post response), fetch_transcript
  • lib/platforms.py — linkedin registered in all four registries
  • lib/urls.pylinkedin.com detection + handle extraction (/in/<handle>, /posts/<handle>_…)
  • lib/scoring.pylikes + 3*comments + 2*reposts
  • lib/dates.pyparse_iso_date for LinkedIn's ISO 8601 datePublished
  • README + SKILL.md — five platforms, credit-cost note

Testing

  • 12 new unit tests (fetcher chain, enrichment fallback, URL handling, scoring, transcripts); full suite: 112 tests, all passing
  • Fixtures follow the documented API response shapes
  • Verified against the live API: profile chain on a real public profile returns posts with correct dates, likes, and comment counts

ScrapeCreators ships LinkedIn endpoints (person profile incl. recentPosts,
post details with engagement + comments, post transcript), so LinkedIn slots
into the existing per-platform fetcher architecture:

- lib/linkedin.py: fetch_profile chains profile -> per-post enrichment
  (recentPosts carry no date/engagement; capped at 8 lookups per profile),
  fetch_post, fetch_comments (from the post response), fetch_transcript
- registries: linkedin registered in all four fetcher maps
- urls: linkedin.com detection + handle extraction (/in/<h>, /posts/<h>_...)
- scoring: likes + 3*comments + 2*reposts
- dates: parse_iso_date for LinkedIn's ISO 8601 datePublished
- tests: 12 new cases (fetcher chain, enrichment fallback, urls, scoring),
  fixtures from the documented API response shapes
- README/SKILL.md: five platforms + credit-cost note for profile fetches

Verified against the live API: profile chain returns real posts with dates
and engagement.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant