Skip to content

OMetaVR/ReadMe-RPCs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spotify Now Playing Logo

A lightweight Node.js server that generates a dynamic image of your currently playing Spotify track,
perfect for embedding in GitHub READMEs, websites, or anywhere that accepts image URLs.

GitHub Repo stars GitHub issues GitHub License


🌟 Features

  • 🎵 Real-time display of currently playing Spotify track
  • 🖼️ Beautiful album artwork with rounded corners
  • 🔄 Automatic fallback to recently played track when nothing is playing
  • 🚀 Lightweight Node.js server
  • 🔒 Secure authentication with Spotify API
  • 💫 Cache-busting headers for always-fresh images
  • 🎨 Clean, modern design

📥 Installation Guide

Prerequisites

  • Node.js 18 or higher
  • npm (Node.js package manager)
  • A Spotify Developer account

Step 1: Clone the Repository

git clone https://github.com/OMetaVR/ReadMe-RPCs.git
cd spotify-done-right

Step 2: Install Dependencies

npm install

Step 3: Set Up Spotify Developer Application

  1. Go to the Spotify Developer Dashboard
  2. Log in with your Spotify account
  3. Click "Create an App"
  4. Fill in the app name and description
  5. Once created, click "Settings"
  6. Add http://localhost:3000/callback to the Redirect URIs and save

Step 4: Get Your Refresh Token

  1. Create a .env file in the root directory with your Spotify credentials:
SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_CLIENT_SECRET=your_client_secret
PORT=3002
  1. Run the token generator:
node get-refresh-token.js
  1. Visit http://localhost:3000/login in your browser
  2. Authorize the application
  3. Copy the refresh token and add it to your .env file:
SPOTIFY_REFRESH_TOKEN=your_refresh_token

Step 5: Start the Server

node src/index.js

Your Now Playing image will be available at:

http://localhost:3002/nowplaying.png

Step 6: Deploy (Optional)

For 24/7 availability, deploy to a hosting service like:

Make sure to:

  1. Set all environment variables on your hosting platform
  2. Update the image URL in your README/website to point to your deployed server

🖼️ Usage in GitHub README

Add this to your README.md (replace the URL with your server's URL):

![Spotify Now Playing](http://your-server:3002/nowplaying.png?t={timestamp})

Note: The ?t={timestamp} parameter helps prevent GitHub's image caching. You might want to use a GitHub Action to automatically update this timestamp periodically.

If all is done correctly you should have something like this, this image is live and is my last song I listened too!!!

Spotify Now Playing Example

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

This project is licensed under the Unlicensed License. See the LICENSE file for details.

🙏 Acknowledgments

About

This is the code to my local server and API for the Spotify recently played track status at the bottom of my readme

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors