在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):popura-network/atoot开源软件地址(OpenSource Url):https://github.com/popura-network/atoot开源编程语言(OpenSource Language):Python 100.0%开源软件介绍(OpenSource Introduction):atootatoot is a Python library providing an easy way to create Mastodon API applications. Key features
Requirements
Getting startedInstallpip install atoot UseBasic usage example: import atoot
import asyncio
async def mastodon_bot():
instance = "botsin.space"
access_token = "YOUR_APPLICATION_ACCESS_TOKEN"
client = await atoot.MastodonAPI.create(instance, access_token=access_token)
resp = await client.verify_account_credentials()
print(resp)
await client.close()
asyncio.run(mastodon_bot()) Using client as a context manager, get 5 pages of home timeline and all notifications: async def mastodon_bot():
instance = "botsin.space"
access_token = "YOUR_APPLICATION_ACCESS_TOKEN"
async with atoot.client(instance, access_token=access_token) as c:
home = await c.get_n_pages(c.home_timeline(limit=20), n=5)
print("Home timeline:", home)
notifs = await c.get_all(c.get_notifications())
print("Notifications:", notifs) LicenseMIT |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论