Pocket操作
- pip install pocket-api
主要是获取CONSUMER KEY和access token
获取CONSUMER KEY
- https://getpocket.com/developer/apps/new
- 设置对应名字和权限,然后得到CONSUMER KEY,名字后面会用到。
oauth 取得code
post请求 https://getpocket.com/v3/oauth/request
consumer_key=
redirect_uri=
:authorizationFinished
返回类似:code=a546cd87-2546-86ea-b213-3d5de4
激活授权
- 浏览器输入:https://getpocket.com/auth/authorize?request_token=a546cd87-2546-86ea-b213-3d5de4&redirect_uri=
:authorizationFinished
- 浏览器输入:https://getpocket.com/auth/authorize?request_token=a546cd87-2546-86ea-b213-3d5de4&redirect_uri=
获取access_token
post请求:https://getpocket.com/v3/oauth/authorize
consumer_key=
code=
返回access_token=
参考https://getpocket.com/developer/docs/v3/retrieve
1 | p = Pocket(consumer_key='',access_token='') |
发送消息到mastodon
获取对应参数:应用 ID,应用密钥,你的访问令牌
pip install mastodon.py
1 | mastodon = Mastodon( |
定时执行
每天1点定时执行
0 1 * * * python /home/youScript.py