Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mastodon/mastodon-api
A ruby interface for the Mastodon API
https://github.com/mastodon/mastodon-api
mastodon mastodon-api
Last synced: about 4 hours ago
JSON representation
A ruby interface for the Mastodon API
- Host: GitHub
- URL: https://github.com/mastodon/mastodon-api
- Owner: mastodon
- Created: 2016-10-20T16:30:55.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-03-13T02:33:04.000Z (10 months ago)
- Last Synced: 2024-12-30T00:37:04.984Z (2 days ago)
- Topics: mastodon, mastodon-api
- Language: Ruby
- Size: 161 KB
- Stars: 173
- Watchers: 19
- Forks: 61
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
Mastodon API Ruby Gem
=====================[![Gem Version](http://img.shields.io/gem/v/mastodon-api.svg)][gem]
[![Build Status](http://img.shields.io/travis/tootsuite/mastodon-api.svg)][travis][gem]: https://rubygems.org/gems/mastodon-api
[travis]: https://travis-ci.org/tootsuite/mastodon-apiA ruby interface for the [Mastodon](https://github.com/tootsuite/mastodon) API.
## Installation
gem 'mastodon-api', require: 'mastodon'
## Documentation
All the documentation is available on [RubyDoc](http://www.rubydoc.info/gems/mastodon-api/Mastodon/REST/API).
## 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.