I'm trying to make an app that grabs a song a user is listening to using a scraper. Right now I can get the user to visit the page and see the song title that is being listened to, but if the song updates they will need to refresh the entire page on their own. I am looking for a way to run the code I have in the routes file and then render the page with the song data, then check every now and then if the data has changed and then refresh the section of the page with the new data.
Here's what I want to happen:
- User sends GET to /songinfo.
- app.get scrapes the data from an outside source.
- app.get renders the ejs file with song data
- Timer goes off/user presses manual refresh button on the page itself
- New data is rendered onto the page and he rest of the website doesn't refresh. Only the song data is refreshed.
Thanks.