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

Zatnosk/libodonjs: JavaScript library for interfacing with mastodon

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

开源软件名称(OpenSource Name):

Zatnosk/libodonjs

开源软件地址(OpenSource Url):

https://github.com/Zatnosk/libodonjs

开源编程语言(OpenSource Language):

JavaScript 100.0%

开源软件介绍(OpenSource Introduction):

libodonjs

JavaScript library for interfacing with mastodon

https://github.com/Gargron/mastodon/wiki/API

Notice

This library isn't finished, and doesn't yet support posting to a mastodon instance.

Registering an app

var app = new Libodon(app_name, redirect_url)
var connection = app.connect(server_url, user_email)
connection.then(conn=>{
  if(conn.result == 'redirect') {
    // conn.target now holds an URL that the browser / user agent should be directed to
  } else if(conn.result == 'success'){
    // connection is successful and the app is usable
  }
})

app_name is the name of your app - can be anything. redirect_url should be the address of your app, but can be the special value of urn:ietf:wg:oauth:2.0:oob to ask to server to just provide the auth code. server_url should be the address of your server e.g. https://mastodon.social user_email is probably unnecessary, but is intended to be the users login email. If the auth code is provided without redirecting back to your app, then you need to load your app with the url parameter code set to the auth code. E.g. localhost/app.html?code=XXXXX

Once you've loaded your app with the auth code, the connection should succeed, and you're ready to use the rest of the API.




鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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