程序源码
- 获取部分:https://github.com/hguandl/dr-feeder
旧 Python 版:https://github.com/hguandl/weibo-watcher- iOS 推送部分:https://github.com/hguandl/bark-server
企业微信推送搭建教程
注册企业
在 企业微信平台 上注册一个企业。企业信息可以随意填写,个人信息需要是真实的。
注册完成后进入管理后台。
创建应用
在管理后台点击顶栏的应用管理:
点击下方的创建应用。
按个人喜好填写信息:
然后创建应用。
获取应用信息
在应用详情内获取 AgentId
和 Secret
:
在“我的企业”-“企业信息”最下方获取企业 ID:
关注微信插件
在“我的企业”-“微信插件”向下拉可以看到邀请二维码,用微信扫码关注即可。这样企业微信的消息就可以直接通过微信接收。
机器人服务搭建教程
(旧)Python 版
在 主程序为 点击展开/折叠
下载源码及依赖
1
2
3
$ git clone https://github.com/hguandl/weibo-watcher.git
$ cd weibo-watcher
$ pip install -r requirements.txt
填写应用信息
1
$ cp config-example.py config.py
config.py
内定义上文中提到的 AgentId
、 Secret
和企业 ID:
1
2
3
corpid = <企业ID>
agentid = <AgentId>
corpsecret = <Secret>
添加企业微信推送
server.py
。可参考 server-example.py
的内容进行修改:
1
$ cp server-example.py server.py
1
2
3
4
5
6
7
8
9
"""
server.py
"""
from config import corpid, agentid, corpsecret
from notification.wechat import work_wechat_notify
def callbacks(weibo):
work_wechat_notify(weibo, corpid, agentid, corpsecret)
运行服务
1
$ python -m server
Go 版