企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
>[danger] **弃用提醒:** > *由于看云对于免费用户的限制愈发严苛,本文档已经迁移至语雀。本文档将不做维护。* > **语雀地址**:[https://www.yuque.com/a632079/nodebb](https://www.yuque.com/a632079/nodebb) ***** ## 通过 NodeBB API 自动发帖 以下 Demo(Python): ```python import requests class auto_topic(): def __init__(self,api_url,bearer_token): self.api_url = api_url self.bearer_token = bearer_token def create(self,uid,cid,title,content): headers = {"Authorization": "Bearer %s"%self.bearer_token} topic = {'uid':uid,'cid':cid,'title':title,'content':content} response = requests.post(self.api_url,headers = headers,data=topic) return response ``` >[info] 编写: [gaokaigithub](https://github.com/gaokaigithub) 维护: PA Team 审核: PA Team & NodeBB China 最后更新: 2017.08.08