0.12
No release in over 3 years
Low commit activity in last 3 years
There's a lot of open issues
A ruby interface to the Mastodon API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7

Runtime

~> 0
~> 3.3
~> 3.7
 Project Readme

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.