Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/rasjonell/spotify-to-mastodon
- Owner: rasjonell
- Created: 2022-08-11T14:26:38.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-11T14:38:17.000Z (over 2 years ago)
- Last Synced: 2024-04-13T12:53:38.740Z (10 months ago)
- Topics: mastodon, spotify-api
- Language: TypeScript
- Homepage:
- Size: 278 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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_