Douyin Comment Sentiment
Use this skill when the user wants to collect, import, analyze, summarize, or report on Douyin comment sentiment.
Compliance Boundary
Only process comment data from one of these sources:
- User-owned Douyin account exports or creator-center exports.
- Douyin Open Platform or an authorized partner API that the user has permission to call.
- A commercial dataset/provider contract that permits analysis.
- A local CSV/JSON file the user confirms they are allowed to use.
Do not scrape Douyin pages, reverse private mobile APIs, bypass login/captcha/rate limits, or collect private/unavailable comments. Do not store nicknames, avatars, profile URLs, phone numbers, or raw user IDs. Hash user identifiers and keep only the minimum text needed for analysis.
If the user provides only a Douyin video/share URL, ask for an authorized export file or an authorized API endpoint instead of attempting page scraping.
Workflow
- Confirm the data source is authorized.
- Accept one of:
- CSV export path.
- JSON export path.
- Authorized API URL plus a token stored in an environment variable.
- Run
scripts/analyze_douyin_comments.py. - Return the sentiment summary, key examples, risk flags, and output file path.
- If the user wants this project's existing dashboard to use the data, export canonical CSV records and import them into the local
sentiment_systempipeline.
Expected Input Fields
The analyzer recognizes common field aliases:
- Comment text:
text,content,comment,comment_text,text_raw. - Comment id:
cid,comment_id,id,source_id. - Video/item id:
aweme_id,video_id,item_id,parent_id. - User id:
open_id,sec_uid,uid,user_id,user_source_id. - Time:
create_time,publish_time,created_at. - Engagement:
digg_count,like,like_count,reply,reply_count,share,share_count.
Commands
Analyze a local CSV export:
python3 openclaw-skills/douyin-comment-sentiment/scripts/analyze_douyin_comments.py \
--csv data/douyin/comments.csv \
--output artifacts/douyin_comment_sentiment_report.json
Analyze a local JSON export:
python3 openclaw-skills/douyin-comment-sentiment/scripts/analyze_douyin_comments.py \
--json data/douyin/comments.json \
--output artifacts/douyin_comment_sentiment_report.json
Analyze an authorized API response:
DOUYIN_ACCESS_TOKEN=... python3 openclaw-skills/douyin-comment-sentiment/scripts/analyze_douyin_comments.py \
--api-url "https://authorized-provider.example.com/comments?video_id=..." \
--token-env DOUYIN_ACCESS_TOKEN \
--output artifacts/douyin_comment_sentiment_report.json
Export canonical CSV for this repository's sentiment system:
python3 openclaw-skills/douyin-comment-sentiment/scripts/analyze_douyin_comments.py \
--csv data/douyin/comments.csv \
--symbol 600519.SH \
--topic-tags "抖音评论|白酒消费" \
--export-canonical data/imports/douyin_authorized_comments.csv \
--output artifacts/douyin_comment_sentiment_report.json
Reporting Style
Report:
- Total comments, valid comments, removed empty/spam-like share.
- Overall positive/negative/neutral distribution.
- Average sentiment score from -100 to 100.
- Dominant emotions: joy, anger, sadness, fear, support, doubt.
- Top negative and positive excerpts with hashed user IDs only.
- Per-video or per-hour hotspots when available.
- Compliance note describing the authorized source and retention expectation.
Tencent Cloud Deployment Notes
For production, deploy this as a small service on CVM or TKE:
- Store raw authorized exports in COS with lifecycle retention.
- Store reports in COS or CDB.
- Put access tokens in Tencent Cloud SSM, never in code or chat.
- Use CLS for logs and alarms.
- Keep API rate limits below the provider's published limits.
微信扫一扫