跳到导航

怎样从Reddit社区挑出值得深入阅读的产品讨论?

想找 Reddit 上值得读的产品讨论,先选两个与产品问题相关的社区,用 reddit.app.fetch_subreddit_feed 和 sort:"NEW" 每个社区各取一页最新帖。给每条候选帖写一句入选理由,再选最多三条读评论。已有帖子链接时,直接去读评论。

例如研究笔记同步,优先挑写清了设备、操作和结果的帖子。「手机端编辑后,电脑端看不到」比只在标题里提到 sync 更值得深入研究。

什么帖子值得选?

看到的线索选择理由可以怎样写
明确描述了离线后多设备冲突有具体条件,可检查后续解释和处理方式
询问现有同步设置怎么选可研究哪些说明不容易理解
比较两种工作方式,并列出利弊适合提炼决策条件,需读完整上下文
只有标题抱怨或笼统赞美先标为待核,等帖子或讨论里出现实际使用场景再选

分数和评论数用来安排阅读顺序;入选理由要写清楚这条帖子能帮助回答哪个研究问题。相关的低分帖也可能有用,高分本身不能证明客户痛点。

先看哪份产物?

posts.csv 列出候选帖子,sources.json 和 coverage.json 记录每份已存页面的来源和覆盖范围。你填入选中的原生帖子 ID 和理由后,prepare_reddit_threads.py 生成 selected-comment-requests.json,作为读取评论的计划。

把选帖交给已连接 BeatAPI 的助手时,可以这样布置:

从这两个相关社区的最新页找笔记同步讨论,最多选3条。每条说明具体使用场景和为什么值得读评论,保留帖子标识与来源。先交候选表,再读选中的讨论。

下面第 1–5 步依次完成取页、整理候选、填写理由和接入评论流程。候选表在本地生成。读完评论证据后再写研究结论。

1. 先定社区和预算,再采集

记录研究的产品任务,以及每个社区为什么相关。请求 reddit.app.fetch_subreddit_feed,subreddit_name 不带 r/,sort 为 NEW,language 为 en-US,need_format 为 false。社区帖子列表不是关键词搜索。帖子列表的输入没有时间范围字段,所以不能把 NEW 页标成历来或今年的高分帖。

两个社区各一页帖子列表,加最多三条帖子各一页评论,计划最多 5 次数据请求。按价格页当前单价估算;额外页、回复和模型分析另算。已存的响应直接复用。要查看 data:reddit.app.fetch_subreddit_feed 当前的参数和价格,调用免费的 Inspect 接口:

curl -sS https://api.beatapi.io/v1/capabilities/inspect \
-H 'Content-Type: application/json' \
-d '{"reference":"data:reddit.app.fetch_subreddit_feed"}'

2. 保存首页响应与原参数

把 SaaS 换成你选定的社区,相关性看社区里的帖子,不只看社区名。请求保存为 request-feed.json:

{"action":"reddit.app.fetch_subreddit_feed","params":{"subreddit_name":"SaaS","sort":"NEW","language":"en-US","need_format":false}}

费用获批后,发送请求并保存响应头和响应:

mkdir reddit-feed-1 &&
curl --fail-with-body -sS https://api.beatapi.io/v1/social-data/call \
-H "Authorization: Bearer $BEATAPI_API_KEY" \
-H 'Content-Type: application/json' \
--data-binary @request-feed.json \
-D reddit-feed-1/headers.txt \
-o reddit-feed-1/response.json

保留 HTTP 状态、请求文件和真实采集时间。第二个社区使用另一份请求文件和目录。失败响应不是空列表:不要自动重试,也不要加页。已经存有原始页时,跳过这一步。

3. 把已存页整理成候选目录

已存响应里,帖子在 data.subredditV3.elements.edges。一条帖子的标题、作者、创建时间、分数和评论数可能分散在不同的 node.cells 条目里。prepare_reddit_threads.py 只合并这五个字段:冲突值拒绝,缺失值和负分保留,adPayload 非空的元素排除。只有原生 t3_ ID 进入可选帖子;其他元素 ID 计入不可用数量,不改造成猜测的帖子 ID。

按原请求参数和真实采集时间填写 feed-inputs.json,示例时间换成你记录的值。第一次运行时 selected 留空:

{"snapshots":[{"params":{"subreddit_name":"SaaS","sort":"NEW","language":"en-US","need_format":false},"file":"reddit-feed-1/response.json","collected_at":"2026-11-16T10:00:00Z"}],"selected":[]}

将下方脚本保存为 prepare_reddit_threads.py,运行 python3 prepare_reddit_threads.py feed-inputs.json feed-review。脚本生成 posts.csv、sources.json、coverage.json、raw-N.json 和一份空的 selected-comment-requests.json,全程不联网。

import csv,datetime,hashlib,json,pathlib,re,sys
manifest_file,output=map(pathlib.Path,sys.argv[1:3])
manifest=json.loads(manifest_file.read_text(encoding="utf-8"))
snapshots=manifest.get("snapshots");selected=manifest.get("selected",[])
if not isinstance(snapshots,list) or not snapshots or not isinstance(selected,list) or len(selected)>3:raise ValueError("Provide saved snapshots and at most three selected posts")
rows=[];posts={};sources=[];communities=set();requests=set();stats={"ad_elements":0,"unusable_elements":0,"duplicate_posts":0}
for snapshot in snapshots:
params=snapshot["params"]
if not isinstance(params,dict) or set(params)-{"subreddit_name","sort","language","need_format","after"}:raise ValueError("Unsupported feed parameter")
community=params.get("subreddit_name")
if not isinstance(community,str) or not re.fullmatch(r"[A-Za-z0-9_]{2,21}",community) or community.lower() in communities:raise ValueError("One saved first page per distinct community")
if params.get("sort")!="NEW" or params.get("need_format") is not False or params.get("language")!="en-US" or params.get("after","")!="":raise ValueError("Use this workflow's raw NEW first-page scope")
communities.add(community.lower())
stamp=snapshot["collected_at"];dt=datetime.datetime.fromisoformat(stamp.replace("Z","+00:00"))
if dt.tzinfo is None:raise ValueError("Collection time needs timezone")
source=pathlib.Path(snapshot["file"])
if not source.is_absolute():source=manifest_file.parent/source
raw=source.read_bytes();response=json.loads(raw)
if not isinstance(response,dict) or response.get("status")!="succeeded" or response.get("action")!="reddit.app.fetch_subreddit_feed" or response.get("error") is not None:raise ValueError("Expected successful raw subreddit feed")
rid=response.get("request_id")
if not isinstance(rid,str) or not rid.strip() or rid in requests:raise ValueError("Distinct real request IDs required")
requests.add(rid)
elements=response["data"]["subredditV3"]["elements"];edges=elements.get("edges")
if not isinstance(edges,list):raise ValueError("Missing feed edges is not an empty page")
digest=hashlib.sha256(raw).hexdigest();saved="raw-"+str(len(sources)+1)+".json"
sources.append({"saved_file":saved,"source_file":str(source.resolve()),"params":params,"collected_at":stamp,"request_id":rid,"sha256":digest,"bytes":raw})
page_posts={}
for position,edge in enumerate(edges,1):
if not isinstance(edge,dict):raise ValueError("Invalid feed edge")
node=edge.get("node")
if node is None:stats["unusable_elements"]+=1;continue
if not isinstance(node,dict):raise ValueError("Unusable non-null feed node")
if node.get("adPayload") is not None:stats["ad_elements"]+=1;continue
ident=node.get("id")
if not isinstance(ident,str) or not re.fullmatch(r"t3_[a-z0-9]{1,17}",ident):stats["unusable_elements"]+=1;continue
cells=node.get("cells")
if not isinstance(cells,list):raise ValueError("Post fields require cells array")
values={}
for cell in cells:
if not isinstance(cell,dict):raise ValueError("Invalid post cell")
for field in ("title","authorName","createdAt","score","commentCount"):
value=cell.get(field)
if value is None:continue
if field in ("score","commentCount"):
if type(value) is not int or abs(value)>9007199254740991 or (field=="commentCount" and value<0):raise ValueError("Invalid or unsafe post count")
elif not isinstance(value,str):raise ValueError("Invalid post text")
if field in values and values[field]!=value:raise ValueError("Conflicting values across cells")
values[field]=value
row={"post_id":ident,"source_community":community,"response_position":position,"title":values.get("title"),"author":values.get("authorName"),"created_at":values.get("createdAt"),"score":values.get("score"),"comment_count":values.get("commentCount"),"post_link":"https://www.reddit.com/comments/"+ident[3:]+"/","request_id":rid,"collected_at":stamp,"source_sha256":digest}
projection={k:row[k] for k in ("title","author","created_at","score","comment_count")}
if ident in page_posts and page_posts[ident]!=projection:raise ValueError("Conflicting duplicate post in one page")
page_posts[ident]=projection
if ident in posts:
stats["duplicate_posts"]+=1
continue
posts[ident]=row;rows.append(row)
plans=[];chosen=set()
for selection in selected:
ident=selection.get("post_id");reason=selection.get("reason")
if ident not in posts or ident in chosen or not isinstance(reason,str) or not reason.strip():raise ValueError("Select a real unique exported post with a review reason")
chosen.add(ident);row=posts[ident]
plans.append({"action":"reddit.app.fetch_post_comments","params":{"post_id":ident,"sort_type":"NEW","need_format":False,"after":"","language":"en-US"},"reason":reason,"source_request_id":row["request_id"],"source_sha256":row["source_sha256"],"executed":False})
output.mkdir()
for item in sources:(output/item["saved_file"]).write_bytes(item["bytes"])
(output/"sources.json").write_text(json.dumps([{k:v for k,v in item.items() if k!="bytes"} for item in sources],ensure_ascii=False,indent=2),encoding="utf-8")
(output/"selected-comment-requests.json").write_text(json.dumps(plans,ensure_ascii=False,indent=2),encoding="utf-8")
columns=["post_id","source_community","response_position","title","author","created_at","score","comment_count","post_link","request_id","collected_at","source_sha256"]
with (output/"posts.csv").open("x",encoding="utf-8-sig",newline="") as handle:
writer=csv.DictWriter(handle,fieldnames=columns);writer.writeheader()
for row in rows:writer.writerow({k:("'"+v if isinstance(v,str) and (v.lstrip().startswith(("=","+","-","@")) or v.startswith(("\t","\r","\n"))) else v) for k,v in row.items()})
(output/"coverage.json").write_text(json.dumps({"saved_communities":len(communities),"exported_posts":len(rows),**stats,"selected_comment_calls":len(plans),"executed_calls":0,"scope":"Saved NEW first pages only; no time-window ranking or full-community coverage"},indent=2),encoding="utf-8")
print(str(output))

4. 选有讨论证据的帖子,不只挑高分

读每条标题,并打开生成的帖子链接查看上下文。选真正涉及产品任务的帖子,不是提到品牌名就入选。posts.csv 里:

  • score 不是客户人数。
  • post_link 是按原生帖子 ID 生成的规范链接,不是接口返回的 permalink。
  • response_position 是帖子在列表里的顺序,不是官方得分排名。
  • source_community 记录帖子从哪个社区取得,不证明作者身份或所属群体。

复制一份清单,在 selected 里填入最多 3 个导出过的帖子 ID 和非空入选理由,再运行到新目录。下面只示意写法:

{"selected": [{"post_id":"t3_REPLACE_WITH_REAL_ID","reason":"这里填写该线程为何涉及本次产品任务"}]}

占位 ID 要换成真实导出 ID,脚本会拒绝占位 ID。脚本也拒绝不在 posts.csv 里的 ID、重复选择和超过 3 个的选择。没有可用帖子的社区仍记录在 sources.json 和 coverage.json 里;结果为空不是多买几页的理由。下结论前,先查清元素被排除的原因。

5. 将选帖接入评论证据流程

selected-comment-requests.json 的每一项是一份未发送的请求计划,带有来源请求号、来源哈希和选帖理由。请求获批后,只把计划里的 action 和 params 作为 API 正文发送;理由和来源字段留在本地。

每份评论响应单独保存,再运行完整评论指南里的 export_comments.py、merge_pages.py 和 reddit_review.py。三个脚本保留原句证据、缺失父评论、删除状态和已审/未审数量,最后生成 question-backlog.json。读完对话再把评论标成问题、抱怨或称赞;只看标题不能认定客户痛点。

prepare_reddit_threads.py 每个社区只处理一份已存首页,不跟进 endCursor,也不创建监控。同一帖子 ID 出现两次时,posts.csv 保留首次观察,所有原始快照仍然保存。哈希只标识本地文件字节,不证明服务器真实性,也不证明记录的时间准确。最终审核时,把原字段、查询范围、选帖理由和后续评论证据一起交付。

怎样挑历来或最近一年的高分讨论?

要找一个社区里长期热门的讨论,用另一个动作 reddit.app.fetch_subreddit_post_channels 请求 TOP 样本:

{"action":"reddit.app.fetch_subreddit_post_channels","params":{"subreddit_name":"SaaS","sort":"TOP","range":"ALL","language":"en-US","need_format":false}}

ALL 表示历来,YEAR 表示平台的年度窗口。研究要求自然年时,按每条帖子的实际发布日期筛选,并报告筛选范围。reddit.app.fetch_subreddit_post_channels 没有公开的续页输入,也没有登记的固定输出,先检查返回里有没有可识别的帖子和分数。TOP 响应单独保存,与 prepare_reddit_threads.py 处理的 NEW 帖子列表分开。核对帖子身份后,用评论研究继续读评论。