MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / comment_post

Function comment_post

wxapp/BREO.py:284–311  ·  view source on GitHub ↗
(token, post_id)

Source from the content-addressed store, hash-verified

282 print(f"❌ 请求错误: {e}")
283
284def comment_post(token, post_id):
285 for _ in range(2): # 评论2次
286 comment_content = get_random_one_word() # 使用随机一言作为评论内容
287 url = "https://breoplus.breo.cn/breo-app/communityBaseInfo/comment"
288 headers = breo_task_headers(token)
289 data = {
290 "anonymoused": 0,
291 "commentText": comment_content,
292 "postId": post_id
293 }
294 try:
295 response = requests.post(url, headers=headers, data=json.dumps(data))
296 if response.status_code == 200:
297 result = response.json()
298 if result.get("success", False):
299 print("✅ 评论成功!")
300 reward = result.get("result") or {}
301 root = reward.get("rootOutVO") or {}
302 print(f"评论内容: {root.get('commentText', comment_content)}")
303 print(f"获得点数: {reward.get('point', 0)}")
304 print(f"成长值: {reward.get('grow', 0)}")
305 else:
306 print(f"❌ 评论失败,错误信息:{result.get('message', '未知错误')}")
307 else:
308 print(f"❌ 请求失败,状态码:{response.status_code}")
309 except Exception as e:
310 print(f"❌ 请求错误: {e}")
311 time.sleep(1) # 避免频繁请求
312
313def browse_mall(token):
314 url = "https://breoplus.breo.cn/breo-app/user/po-task-info/mall"

Callers 1

BREO.pyFile · 0.85

Calls 6

get_random_one_wordFunction · 0.85
breo_task_headersFunction · 0.85
sleepMethod · 0.80
printFunction · 0.50
postMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected