Skip to content

bkerley/mastodon.cr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mastodon

Build Status

A Crystal-lang library for Mastodon API

Installation

Add this to your application's shard.yml:

dependencies:
  mastodon:
    github: decors/mastodon.cr

Usage

require "mastodon"

Regist application & Authenticate

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

client = Mastodon::REST::Client.new(url: "example.com", access_token: "ACCESS_TOKEN")

Todo

  • OAuth : scope handling

Contributing

  1. Fork it ( https://github.com/decors/mastodon.cr/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • Decors - creator, maintainer

About

A Crystal-lang library for Mastodon API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Crystal 100.0%