Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rasjonell/spotify-to-mastodon

Show your currently playing Spotify track on Mastodon
https://github.com/rasjonell/spotify-to-mastodon

mastodon spotify-api

Last synced: 1 day ago
JSON representation

Show your currently playing Spotify track on Mastodon

Awesome Lists containing this project

README

        

# Spotify To Mastodon

Show your currently playing Spotify track on Mastodon

![Mastodon Screenshot](./screenshot.png)

# Usage

Clone the project and navigate to the project directory.

```sh
$ git clone https://github.com/rasjonell/spotify-to-mastodon
$ cd spotify-to-mastodon
```

Install dependencies

```sh
$ npm install
```

Change the `src/services/spotify.ts` file with your credentials.

```ts
const SpotifyClient = new SpotifyAPI({
clientId: '',
clientSecret: '',
accessToken: '',
refreshToken: '',
});
```

Change the Mastodon instance URL in `src/index.ts`

```ts
const result = await fetch(
'https:///api/v1/accounts/update_credentials',
{...}
```

Run the service

```sh
npm run start
```

_Note: you might want to create a cron job to perform this script recurrently_