• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Shinmera/tooter: A Common Lisp client library for Mastodon instances.

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

Shinmera/tooter

开源软件地址(OpenSource Url):

https://github.com/Shinmera/tooter

开源编程语言(OpenSource Language):

Common Lisp 100.0%

开源软件介绍(OpenSource Introduction):

About Tooter

This is a client library implementing the full v1 REST API protocol for Mastodon.

How To

Before you start, you'll need an account on some Mastodon instance. For the purposes of this documentation we'll simply pick mastodon.social. Once you've got Tooter loaded you'll first need to create a client instance.

(defvar *client* (make-instance 'tooter:client
                   :base "https://mastodon.social"
                   :name "My Tooter Test App"))

Once you have a client set up, you need to authorise it against your account so that you can make requests on your behalf.

(tooter:authorize *client*)

This will return an URL as its secondary value. Visit this URL in your browser, click on the authorize button, and copy the code it displays. Then call authorize again using this code.

(tooter:authorize *client* "...")

If everything goes well this should return a fully authorised client instance.

(tooter:account *client*)

From here on out you can make use of the full API Mastodon API. See the definition index below.

(tooter:make-status *client* "Tooter works, woah nelly!")

Persisting Client Settings

Once you have authorised your client, you will probably want to save the information somewhere so that the user doesn't need to re-authorise every time. To do this, simply save the key, secret, and access-token values from the client instance. If those are set, the authorize steps are not needed.

Writing an Application Library

If you write an application on top of Mastodon and would like to offer this as another re-usable library, you should create a subclass of client that automatically provides the proper initargs for the :name and so forth. This ensures that your application is known under the correct name, but still lets the user specify the correct :base.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap