mastodon.cr
forked frommastodon
A Crystal-lang library for Mastodon API
Installation
Add this to your application's shard.yml
:
dependencies:
mastodon:
github: watzon/mastodon.cr
Usage
require "mastodon"
Register application & Authenticate
client = Mastodon::Client.new(url: "example.com")
app = client.apps("My Mastodon App", scopes: "read write follow")
token = client.get_access_token_using_username_password(
client_id: app.client_id,
client_secret: app.client_secret,
scopes: "read write follow",
username: "USERNAME",
password: "PASSWORD"
)
client.authenticate(token)
Client
client = Mastodon::API::Client.new(url: "example.com", access_token: "ACCESS_TOKEN")
Todo
- OAuth : scope handling
Contributing
- Fork it ( https://github.com/watzon/mastodon.cr/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
Repository
mastodon.cr
Owner
Statistic
- 0
- 0
- 0
- 1
- 1
- almost 2 years ago
- November 8, 2022
License
MIT License
Links
Synced at
Mon, 18 Nov 2024 00:43:18 GMT
Languages