Get Pocket to send to mastodon

hellolinux2021
·
·
IPFS
·

Pocket operation

Mainly to get CONSUMER KEY and access token

 consumer_key=<consumer_key>
redirect_uri=<app_name>:authorizationFinished
 consumer_key=
code=
  • return access_token=

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

 p = Pocket(consumer_key='',access_token='')
p.retrieve(offset=0,count=5,tag='hk',since=test_timestamp)
# Read resolved_url and resolved_title according to the return value

send message to mastodon

 mastodon = Mastodon(
client_id='',
client_secret='',
access_token = '',
api_base_url = 'https://domain'
)
mastodon.toot(str)
# str is the text to send, other parameters refer to docs

Timed execution

Executed at 00:00 every day

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

refer to

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

Pocket API + Python study notes

Share your own reading list with Pocket API

Mastodon | Weibo forwarded to Mastodon bot

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

Automatically get Pocket and send to mastodon


CC BY-NC-ND 2.0

Like my work? Don't forget to support and clap, let me know that you are with me on the road of creation. Keep this enthusiasm together!

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

20220820近况更新

费曼学习法

obsidian的annotator插件