tracking-brand-sentiment-across-platforms

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Tracking Brand Sentiment Across Platforms

跨平台品牌舆情追踪

Monitors brand sentiment on Twitter, Reddit, and TikTok in parallel, then produces a unified brand health score. Each platform serves a different role: Twitter = real-time news/opinion, Reddit = deep community discussion, TikTok = Gen Z product culture.
并行监测Twitter、Reddit和TikTok三大平台的品牌舆情,生成统一的品牌健康分。各平台定位不同:Twitter = 实时资讯/观点、Reddit = 深度社区讨论、TikTok = Z世代产品文化。

Prerequisites

前置条件

  • APIFY_TOKEN
    environment variable set
  • Optional: Apify MCP server installed
  • 已设置
    APIFY_TOKEN
    环境变量
  • 可选:已安装Apify MCP服务器

Inputs

输入参数

ParameterTypeRequiredDefaultNotes
searchTerms
array
[]
Twitter advanced search queries (e.g.
["#AI lang:en", "from:NASA"]
)
sort
stringOptional
Top
Sort order:
Latest
,
Top
, or
Latest+Top
tweetLanguage
stringOptionalISO 639-1 language code (e.g.
en
)
maxItems
numberOptionalUnlimitedMaximum tweets to return
onlyVerifiedUsers
booleanOptional
false
Only tweets from verified users
onlyTwitterBlue
booleanOptional
false
Only Twitter Blue subscribers
onlyImage
booleanOptional
false
Only tweets with images
onlyVideo
booleanOptional
false
Only tweets with videos
onlyQuote
booleanOptional
false
Only quote tweets
author
stringOptionalFilter to a specific author handle
inReplyTo
stringOptionalTweets replying to a specific handle
mentioning
stringOptionalTweets mentioning a specific handle
geotaggedNear
stringOptionalTweets near a location
withinRadius
stringOptionalRadius around geotaggedNear
geocode
stringOptionalLat/lng + radius string
placeObjectId
stringOptionalTweets tagged with a place
minimumRetweets
numberOptionalMinimum retweet count
minimumFavorites
numberOptionalMinimum like count
minimumReplies
numberOptionalMinimum reply count
start
stringOptionalTweets after this date (YYYY-MM-DD)
end
stringOptionalTweets before this date (YYYY-MM-DD)
includeSearchTerms
booleanOptional
false
Add the matched search term to each tweet
customMapFunction
stringOptionalJavaScript function to transform each output object
参数名称类型是否必填默认值说明
searchTerms
数组
[]
Twitter高级搜索查询语句(例如:
["#AI lang:en", "from:NASA"]
sort
字符串可选
Top
排序方式:
Latest
Top
Latest+Top
tweetLanguage
字符串可选ISO 639-1语言代码(例如:
en
maxItems
数字可选无限制返回的最大推文数量
onlyVerifiedUsers
布尔值可选
false
仅返回认证用户的推文
onlyTwitterBlue
布尔值可选
false
仅返回Twitter Blue订阅用户的推文
onlyImage
布尔值可选
false
仅返回带图片的推文
onlyVideo
布尔值可选
false
仅返回带视频的推文
onlyQuote
布尔值可选
false
仅返回引用推文
author
字符串可选筛选特定作者的推文
inReplyTo
字符串可选筛选回复特定账号的推文
mentioning
字符串可选筛选提及特定账号的推文
geotaggedNear
字符串可选筛选特定地点附近的推文
withinRadius
字符串可选
geotaggedNear
参数对应的范围半径
geocode
字符串可选纬度/经度 + 半径字符串
placeObjectId
字符串可选筛选标记特定地点的推文
minimumRetweets
数字可选筛选转发量达到最小值的推文
minimumFavorites
数字可选筛选点赞量达到最小值的推文
minimumReplies
数字可选筛选回复量达到最小值的推文
start
字符串可选筛选该日期之后的推文(格式:YYYY-MM-DD)
end
字符串可选筛选该日期之前的推文(格式:YYYY-MM-DD)
includeSearchTerms
布尔值可选
false
为每条推文添加匹配的搜索词
customMapFunction
字符串可选用于转换每个输出对象的JavaScript函数

Workflow

工作流程

Progress:
- [ ] Step 1: Run scrapers for all three platforms in parallel
- [ ] Step 2: Classify sentiment per platform
- [ ] Step 3: Calculate cross-platform brand health score
- [ ] Step 4: Identify top themes and alerts
- [ ] Step 5: Deliver unified report
进度:
- [ ] 步骤1:并行运行三大平台的爬虫
- [ ] 步骤2:按平台进行舆情分类
- [ ] 步骤3:计算跨平台品牌健康分
- [ ] 步骤4:识别热门主题与预警
- [ ] 步骤5:交付统一报告

Step 1: Run Three Scrapers

步骤1:运行三个爬虫

Twitter (If Apify MCP is available):
Tool: apify:run-actor
Actor: "apidojo~tweet-scraper"
Input: {"searchTerms": ["[BRAND_NAME]"], "maxItems": 300, "tweetLanguage": "en"}
Reddit:
Tool: apify:run-actor
Actor: "apidojo~tweet-scraper"
Input: {"searches": ["[BRAND_NAME]"], "maxItems": 200, "sort": "new", "time": "month"}
TikTok:
Tool: apify:run-actor
Actor: "apidojo~tiktok-scraper"
Input: {"keywords": ["#[brandname]", "#[brandname]review"], "maxItems": 200}
REST API fallback — run each sequentially:
bash
undefined
Twitter(若Apify MCP可用):
工具: apify:run-actor
Actor: "apidojo~tweet-scraper"
输入: {"searchTerms": ["[BRAND_NAME]"], "maxItems": 300, "tweetLanguage": "en"}
Reddit:
工具: apify:run-actor
Actor: "apidojo~tweet-scraper"
输入: {"searches": ["[BRAND_NAME]"], "maxItems": 200, "sort": "new", "time": "month"}
TikTok:
工具: apify:run-actor
Actor: "apidojo~tiktok-scraper"
输入: {"keywords": ["#[brandname]", "#[brandname]review"], "maxItems": 200}
REST API备选方案 — 按顺序运行每个爬虫:
bash
undefined

Twitter

Twitter

curl -X POST "https://api.apify.com/v2/acts/apidojo~tweet-scraper/runs?token=$APIFY_TOKEN" -H "Content-Type: application/json" -d '{"searchTerms": ["[BRAND_NAME]"], "maxItems": 300}'
curl -X POST "https://api.apify.com/v2/acts/apidojo~tweet-scraper/runs?token=$APIFY_TOKEN" -H "Content-Type: application/json" -d '{"searchTerms": ["[BRAND_NAME]"], "maxItems": 300}'

Reddit

Reddit

curl -X POST "https://api.apify.com/v2/acts/apidojo~tweet-scraper/runs?token=$APIFY_TOKEN" -H "Content-Type: application/json" -d '{"searches": ["[BRAND_NAME]"], "maxItems": 200, "sort": "new", "time": "month"}'
undefined
curl -X POST "https://api.apify.com/v2/acts/apidojo~tweet-scraper/runs?token=$APIFY_TOKEN" -H "Content-Type: application/json" -d '{"searches": ["[BRAND_NAME]"], "maxItems": 200, "sort": "new", "time": "month"}'
undefined

Step 2: Sentiment Classification

步骤2:舆情分类

Use the same lexical model for all platforms (positive/negative/neutral indicators from
analyzing-twitter-sentiment-for-topic
skill). Weight by platform-specific engagement:
  • Twitter:
    likeCount + replyCount * 3
  • Reddit:
    upvotes + commentCount * 2
  • TikTok:
    playCount / 1000 + diggCount
所有平台使用相同的词汇模型(来自
analyzing-twitter-sentiment-for-topic
技能的正面/负面/中性指标),并根据平台特定的互动数据加权:
  • Twitter:
    likeCount + replyCount * 3
  • Reddit:
    upvotes + commentCount * 2
  • TikTok:
    playCount / 1000 + diggCount

Step 3: Brand Health Score

步骤3:品牌健康分计算

platform_sentiment[p] = (positive_count[p] - negative_count[p]) / total_count[p]  # range: -1 to +1

platform_weight = {twitter: 0.35, reddit: 0.40, tiktok: 0.25}  # Reddit = most considered opinion

brand_health_score = sum(platform_sentiment[p] * platform_weight[p] for p in platforms)
brand_health_score = (brand_health_score + 1) / 2 * 100  # normalize to 0-100
Score interpretation: 0–40 = Crisis, 40–55 = Concerning, 55–70 = Neutral, 70–85 = Positive, 85–100 = Strong.
platform_sentiment[p] = (positive_count[p] - negative_count[p]) / total_count[p]  # 范围:-1 至 +1

platform_weight = {twitter: 0.35, reddit: 0.40, tiktok: 0.25}  # Reddit权重最高,代表深度观点

brand_health_score = sum(platform_sentiment[p] * platform_weight[p] for p in platforms)
brand_health_score = (brand_health_score + 1) / 2 * 100  # 归一化至0-100分
得分解读:0–40 = 危机、40–55 = 值得关注、55–70 = 中性、70–85 = 正面、85–100 = 良好。

Step 4: Edge Cases

步骤4:特殊场景处理

  • Brand name is a common word (e.g. "Apple"): Add qualifier ("Apple iPhone", "Apple Inc") to search to reduce noise; report disambiguation rate
  • One platform dominates volume (e.g. TikTok has 10× Twitter posts): Weight by volume in the composite score
  • Rapid sentiment shift (score changes > 20 points): Flag as
    ALERT
    — may indicate PR crisis or viral positive moment
  • Reddit returns no results: Brand may not be discussed there; set
    reddit_weight = 0
    and redistribute to other platforms
  • 品牌名称为通用词汇(例如:"Apple"):在搜索词中添加限定词(如"Apple iPhone"、"Apple Inc")以减少干扰;报告消歧率
  • 单一平台内容量占主导(例如:TikTok内容量是Twitter的10倍):在综合得分中按内容量调整权重
  • 舆情快速变化(得分变动超过20分):标记为
    ALERT
    ——可能预示公关危机或正向 viral 事件
  • Reddit无结果返回:品牌可能未在该平台被讨论;将
    reddit_weight
    设为0并重新分配权重至其他平台

Output Format

输出格式

undefined
undefined

Cross-Platform Brand Sentiment: [BRAND_NAME]

跨平台品牌舆情:[BRAND_NAME]

Period: [DATE_RANGE] | Total posts: [N] | Date: [DATE]
统计周期:[DATE_RANGE] | 总帖子数:[N] | 生成日期:[DATE]

Brand Health Score: [X]/100 — [INTERPRETATION]

品牌健康分:[X]/100 — [解读结果]

Per-Platform Breakdown

各平台详情

PlatformPostsPositiveNegativeNeutralScore
Twitter[N][X%][X%][X%][+/-X]
Reddit[N][X%][X%][X%][+/-X]
TikTok[N][X%][X%][X%][+/-X]
平台帖子数正面占比负面占比中性占比平台得分
Twitter[N][X%][X%][X%][+/-X]
Reddit[N][X%][X%][X%][+/-X]
TikTok[N][X%][X%][X%][+/-X]

Top Negative Themes (Cross-Platform)

跨平台热门负面主题

  1. [Theme] — [N] posts across [platforms]
  2. [Theme]
  1. [主题] — 涉及[平台]共[N]条帖子
  2. [主题]

Top Positive Themes

热门正面主题

  1. [Theme] — [N] posts
  2. [Theme]
  1. [主题] — 共[N]条帖子
  2. [主题]

Most Impactful Posts

高影响力帖子

🔴 Top negative: [platform] | [handle] | [N engagement] | "[excerpt]" 🟢 Top positive: [platform] | [handle] | [N engagement] | "[excerpt]"
undefined
🔴 热门负面:[平台] | [账号] | [互动量] | "[内容摘要]" 🟢 热门正面:[平台] | [账号] | [互动量] | "[内容摘要]"
undefined

Troubleshooting

问题排查

Brand health score conflicts between platforms: This is meaningful signal — discuss in output why platforms diverge (e.g. "Reddit community discusses product quality issues while TikTok shows positive unboxing content"). Sample too small for reliable sentiment (< 50 posts per platform): Widen date range or note low confidence in that platform's score. Brand name not found on a platform: Some brands have no organic TikTok presence — note as gap in output.
Recommended — run_actor.js (handles waiting, output, and file saving automatically):
bash
undefined
各平台品牌健康分存在差异:这是有价值的信号——在输出中说明平台差异的原因(例如:"Reddit社区讨论产品质量问题,而TikTok上则是正面的开箱内容")。 样本量过小导致舆情结果不可靠(单平台帖子数<50):扩大统计日期范围,或标注该平台得分可信度低。 某平台未搜索到品牌相关内容:部分品牌在TikTok等平台无自然曝光——在输出中注明该缺口。
推荐使用 — run_actor.js(自动处理等待、输出及文件保存):
bash
undefined

Quick answer (prints table to chat)

快速输出(在聊天窗口打印表格)

node scripts/run_actor.js
--actor "apidojo~tweet-scraper"
--input '{"param": "value"}'
node scripts/run_actor.js
--actor "apidojo~tweet-scraper"
--input '{"param": "value"}'

Save as CSV

保存为CSV文件

node scripts/run_actor.js
--actor "apidojo~tweet-scraper"
--input '{"param": "value"}'
--output YYYY-MM-DD_results.csv --format csv
node scripts/run_actor.js
--actor "apidojo~tweet-scraper"
--input '{"param": "value"}'
--output YYYY-MM-DD_results.csv --format csv

Save as JSON

保存为JSON文件

node scripts/run_actor.js
--actor "apidojo~tweet-scraper"
--input '{"param": "value"}'
--output YYYY-MM-DD_results.json --format json
> `APIFY_TOKEN` must be set in environment or `.env` file.
node scripts/run_actor.js
--actor "apidojo~tweet-scraper"
--input '{"param": "value"}'
--output YYYY-MM-DD_results.json --format json
> `APIFY_TOKEN`需在环境变量或`.env`文件中配置。