Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/transitive-bullshit/spotify-to-twitter
Example of how to create your own automated Twitter account that tweets tracks from a Spotify playlist.
https://github.com/transitive-bullshit/spotify-to-twitter
Last synced: 4 months ago
JSON representation
Example of how to create your own automated Twitter account that tweets tracks from a Spotify playlist.
- Host: GitHub
- URL: https://github.com/transitive-bullshit/spotify-to-twitter
- Owner: transitive-bullshit
- Created: 2020-07-21T09:28:13.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-05T07:02:26.000Z (almost 2 years ago)
- Last Synced: 2024-10-20T01:09:55.320Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 738 KB
- Stars: 21
- Watchers: 3
- Forks: 3
- Open Issues: 10
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# spotify-to-twitter
> Example of how to create an automated Twitter account that tweets tracks from a Spotify playlist.
[](https://travis-ci.com/transitive-bullshit/get-apex-domain-name) [](https://standardjs.com)
## Usage
First clone this repo and run `npm install`.
You'll need to sign up for both Twitter and Spotify developer accounts and then paste your credentials into a local `.env` file following [.env.example](./.env.example).
```sh
# app credentialsPROVIDER_SPOTIFY_CLIENT_ID=
PROVIDER_SPOTIFY_CLIENT_SECRET=
PROVIDER_SPOTIFY_REDIRECT_URI=PROVIDER_TWITTER_CLIENT_ID=
PROVIDER_TWITTER_CLIENT_SECRET=# user credentials
SPOTIFY_USER_ACCESS_TOKEN=
SPOTIFY_USER_REFRESH_TOKEN=TWITTER_USER_ACCESS_TOKEN=
TWITTER_USER_ACCESS_TOKEN_SECRET=# automation settings
# URL or ID of spotify playlist to pull tracks from
# example: https://open.spotify.com/playlist/2MgkBl2rQnPdF3WZ6ciajc?si=gF7XkYJLRBWo8lxoMKmySA
SPOTIFY_PLAYLIST=
```Then, just run `node index.js`.
This will pick a random track from the given Spotify playlist and tweet it from your account, adding a bit of text and a few random hashtags as well.
If you want to automate your account to tweet on a regular schedule, check out [cron](https://opensource.com/article/17/11/how-use-cron-linux) or a hosted cron solution like [Simple Cron](https://simplecron.dev).
Here's an ([example ambient playlist](https://open.spotify.com/playlist/2MgkBl2rQnPdF3WZ6ciajc?si=keroU0kmS7CcgXiw-toJjQ)) if you'd like to get started.
## Why tho?
Purely for fun: [LofiGrind](https://twitter.com/lofigrind). 🤓
I was inspired by lofi DJs like [ChilledCow](https://twitter.com/ChilledCow?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor) who have created large followings by curating fresh music on a regular basis across [YouTube](https://www.youtube.com/channel/UCSJ4gkVC6NrvII8umztf0Ow), [Twitter](https://twitter.com/ChilledCow?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor), [Spotify](https://open.spotify.com/user/chilledcow?si=VeqVRyGHTcqQylOesJ0PpA), etc.
## License
MIT © [Travis Fischer](https://github.com/transitive-bullshit)
Support my OSS work by following me on twitter
![]()