A Crystal-lang library for Mastodon API
Add this to your application's shard.yml
:
dependencies:
mastodon:
github: decors/mastodon.cr
require "mastodon"
client = Mastodon::REST::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 = Mastodon::REST::Client.new(url: "example.com", access_token: "ACCESS_TOKEN")
- OAuth : scope handling
- Fork it ( https://github.com/decors/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
- Decors - creator, maintainer