Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hbish/gatsby-source-mastodon
A Gatsby source plugin for fetching user toots from Mastodon
https://github.com/hbish/gatsby-source-mastodon
gatsby-plugin gatsbyjs mastodon mastodon-api
Last synced: about 1 month ago
JSON representation
A Gatsby source plugin for fetching user toots from Mastodon
- Host: GitHub
- URL: https://github.com/hbish/gatsby-source-mastodon
- Owner: hbish
- License: mit
- Created: 2018-11-02T13:15:14.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-04T11:24:56.000Z (about 6 years ago)
- Last Synced: 2024-05-23T04:04:52.848Z (7 months ago)
- Topics: gatsby-plugin, gatsbyjs, mastodon, mastodon-api
- Language: JavaScript
- Size: 238 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - gatsby-source-mastodon - A Gatsby source plugin for fetching user toots from Mastodon (JavaScript)
README
# gatsby-source-mastodon
![gatsby-source-mastodon logo](https://github.com/hbish/gatsby-source-mastodon/raw/master/static/logo.png)
A Gatsby source plugin for fetching user toots from Mastodon.
Currently only support a user's own toots.
## Usage
You will need to create an `Application` with `read` permission from your Mastodon instance (e.g. https://aus.social/settings/applications).
Add the following block of configuration into your `gatsby-config.js`. Replace fields surrounded by `***` with the correct details.
```javascript
module.exports = {
plugins: [
{
resolve: 'gatsby-source-mastodon',
options: {
// The api url of your mastodon instance (e.g https://aus.social/api/v1)
api_url: '***MASTODON_INSTANCE_API_URL***',
// Number of toots to return
limit: 25,
// Access token for your Mastodon application
access_token: '***MASTODON_ACCESS_TOKEN***',
},
],
}
```## Query Mastodon Data
A sample of the query is included below, for all available field please check the graphl browser.
```graphql
{
allToot {
edges {
node {
id
url
content
reblogs_count
favourites_count
account {
username
}
}
}
}
}
```