A ruby interface for the Mastodon API

Luiz Picolo ツ 60b0ed09c3 Added new instruction to usage (#48) %!s(int64=4) %!d(string=hai) anos
.github 526accca5c Update gempush.yml %!s(int64=4) %!d(string=hai) anos
lib aed7ae9b43 Fix update media method, add spec (#47) %!s(int64=4) %!d(string=hai) anos
spec aed7ae9b43 Fix update media method, add spec (#47) %!s(int64=4) %!d(string=hai) anos
.codeclimate.yml 6e40f2ce0e Bump to 1.0 %!s(int64=8) %!d(string=hai) anos
.gitignore b29141f258 Fix build by removing lockfile and updating gemspec. %!s(int64=5) %!d(string=hai) anos
.rspec de2216e8fe Initial commit %!s(int64=8) %!d(string=hai) anos
.rubocop.yml 0e9725187d Group the cops by department in configuration files %!s(int64=7) %!d(string=hai) anos
.travis.yml 3b6463cb0d Allow failures on ruby-head %!s(int64=5) %!d(string=hai) anos
CHANGELOG.md 4e75becc83 Bring API support up to date %!s(int64=5) %!d(string=hai) anos
Gemfile 6e40f2ce0e Bump to 1.0 %!s(int64=8) %!d(string=hai) anos
README.md 60b0ed09c3 Added new instruction to usage (#48) %!s(int64=4) %!d(string=hai) anos
Rakefile 6e40f2ce0e Bump to 1.0 %!s(int64=8) %!d(string=hai) anos
mastodon.gemspec b29141f258 Fix build by removing lockfile and updating gemspec. %!s(int64=5) %!d(string=hai) anos

README.md

Mastodon API Ruby Gem

Gem Version Build Status

A ruby interface for the Mastodon API.

Installation

gem 'mastodon-api', require: 'mastodon'

Documentation

All the documentation is available on RubyDoc.

Usage

Assuming that you already have an access token for a user on a given Mastodon instance:

require 'mastodon'

client = Mastodon::REST::Client.new(base_url: 'https://mastodon.social', bearer_token: 'your_access_token')

If you need to get an access token, you must first ensure that you have the client ID and client secret for your app on the given Mastodon instance (you should save those for future calls):

client.create_app('My Ruby App', 'http://mywebsite.com/callback')

You can then use the client ID and secret in a standard OAuth 2 authorization flow.