hellolinux2021
hellolinux2021

欢迎拍手与交流,个人Channel:https://t.me/hellolinuxLab Sentinel DVPN中文社区管理,技术及使用支持 https://t.me/Sentinel_China 个人主页:https://hellolinux.uk/about

获取Pocket发送到mastodon

Pocket操作

主要是获取CONSUMER KEY和access token

consumer_key=<consumer_key>
redirect_uri=<app_name>:authorizationFinished
consumer_key=
code=
  • 返回access_token=

参考https://getpocket.com/developer/docs/v3/retrieve

p = Pocket(consumer_key='',access_token='')
p.retrieve(offset=0,count=5,tag='hk',since=test_timestamp)
# 根据返回值读取 resolved_url和resolved_title

发送消息到mastodon

mastodon = Mastodon(
  client_id='',
  client_secret='',
  access_token = '',
  api_base_url = 'https://domain'
)
mastodon.toot(str)
# str为发送文本,其他参数参考docs

定时执行

每天00点定时执行

0 10 * * * python /home/youScript.py

参考

https://getpocket.com/developer/docs/v3/retrieve

Pocket API + Python 學習筆記

利用Pocket API实现分享自己的阅读列表

Mastodon | 微博转发到 Mastodon bot

https://mastodonpy.readthedocs.io/en/stable/

自动获取Pocket发送到mastodon


CC BY-NC-ND 2.0 版权声明

喜欢我的文章吗?
别忘了给点支持与赞赏,让我知道创作的路上有你陪伴。

加载中…
加载中…

发布评论