This simple web application displays the currently playing track from Spotify and fetches its lyrics using the Vagalume API.
-
Get your Spotify Client ID and Secret from Spotify Developer.
- Click in 'Create App' and add a 'Name' and 'Description'.
- Add http://localhost:8080/index.html in 'Redirect URIs'.
- Click in the checkbox that you accept the Spotify's Developer ToS and click in 'Save'.
- Go to Settings inside of the app that you just created, and you have your Client ID.
-
Get your Vagalume API Key from Vagalume.
- Go to 'Meus Dados' on your profile and click in 'API'.
- Click in 'Adicionar Crendencial' and add a 'Nome'.
- The 'Crendencial' is your API Key.
-
Clone the repository to your local machine.
-
Create a
config.json
file in the root directory of the project with the following structure:{ "clientId": "YOUR_SPOTIFY_CLIENT_ID", "apiKey": "YOUR_VAGALUME_API_KEY" }
Replace
YOUR_SPOTIFY_CLIENT_ID
with your Spotify client ID andYOUR_VAGALUME_API_KEY
with your Vagalume API Key.
- Run and open
index.html
in your web browser.
- Ensure you have Node.js and npm installed on your machine.
- Install Electron by running
npm install electron --save-dev
. - Run
npm install
to install dependencies. - Install a simple HTTP server globally by running
npm install -g http-server
. - Run
npm start
in the project directory to start the application. - Alternatively, to open the app by clicking on an executable file, run
npx electron-packager . Spotify-Lyrics
.- The packaged application will be available in the
Spotify-Lyrics
directory.
- The packaged application will be available in the
- When the page loads, it fetches the currently playing track from Spotify using the Spotify Web API.
- It then fetches the lyrics of the currently playing track using the Vagalume API.
- The lyrics are displayed on the webpage.
- If the music changes, you will need to reload the page.
- jQuery: Used for making AJAX requests to the Vagalume API.
- Spotify Web API: Used for fetching the currently playing track from Spotify.
- Vagalume API: Used for fetching the lyrics of the currently playing track.
- Electron: Used for creating standalone desktop applications.
This project is licensed under the MIT License. See the LICENSE file for details.