I'm currently working on creating an app that can retrieve the song a user is currently listening to using a web scraper. While I've managed to direct users to the page and display the current song title, they must manually refresh the entire page if the song changes. I'm exploring options to execute the code in the routes file to dynamically update the song data on the page without requiring a full refresh.
Desired functionality:
- User initiates a GET request to /songinfo endpoint.
- The app scrapes the latest song information from an external source.
- The app renders the EJS file with the updated song data.
- A timer triggers or the user manually initiates a refresh action.
- Only the song data section of the page updates with the new information while the rest of the content remains unaffected.
Thank you for your help!