Skip to content

Add generic comments API with normalized SocialComment shape#106

Merged
chubes4 merged 1 commit into
mainfrom
feat/generic-comments-api
Mar 30, 2026
Merged

Add generic comments API with normalized SocialComment shape#106
chubes4 merged 1 commit into
mainfrom
feat/generic-comments-api

Conversation

@chubes4
Copy link
Copy Markdown
Member

@chubes4 chubes4 commented Mar 30, 2026

Summary

  • Phase 1 of giveaway winner picker: generic comment infrastructure across platforms
  • New comments_all action on InstagramReadAbility that auto-paginates all comments and returns normalized SocialComment shape (id, platform, author_username, text, timestamp, like_count, mentions[], parent_id, raw)
  • @mention parsing via regex on comment text
  • Generic REST endpoints: GET /datamachine-socials/v1/comments/{platform} and POST /datamachine-socials/v1/comments/{platform}/reply
  • New CommentsCommand CLI: wp datamachine-socials comments list/reply with --has-mentions, --min-mentions, --exclude, --format=json/csv/count
  • Backward compatible: existing comments action unchanged

Why

Instagram giveaways need to fetch all comments, parse @tags, and filter entries. Rather than building Instagram-specific tooling, this adds a generic comment surface that any DM Socials platform can implement — useful for giveaways, engagement management, moderation, and CLI scripting.

Test

wp datamachine-socials comments list instagram <media_id> --allow-root
wp datamachine-socials comments list instagram <media_id> --has-mentions --format=json --allow-root

Phase 1 of giveaway winner picker: generic comment infrastructure that
works across platforms. Instagram is the first implementation.

- InstagramReadAbility: new comments_all action auto-paginates all comments
  and returns normalized SocialComment shape (id, platform, author_username,
  text, timestamp, like_count, mentions[], parent_id, raw)
- @mention parsing via regex on comment text
- Generic REST endpoints: GET /comments/{platform} and POST /comments/{platform}/reply
- New CommentsCommand CLI: wp datamachine-socials comments list/reply
- CLI supports --has-mentions, --min-mentions, --exclude, --format=json/csv/count
- Backward compatible: existing comments action unchanged
@chubes4 chubes4 merged commit cb2b3b4 into main Mar 30, 2026
1 check failed
@chubes4 chubes4 deleted the feat/generic-comments-api branch March 30, 2026 16:37
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