01-31-2024, 11:15 PM
(This post was last modified: 01-31-2024, 11:16 PM by Tim Curtis.)
Seems like thats the only way to do it other than their WebAPI but thats not compatible with Open Source license.
It would prolly break if they change the DOM for that website.
In any case here's an overall approach
- Spotify event script writes trackID to /tmp file
- PHP daemon polls the file for change in trackID (or use inotify in a BASH daemon)
---- If changed, scrape the website and cache the data somewhere
---- Send a message + data to the front-end via sendEngCmd()
- Front end receives the message + data and updates the WebUI (only for chromium/local display) with new metadata from the cache
- If page is refreshed re-load metadata from cache into WebUI
Something like that.
It would prolly break if they change the DOM for that website.
In any case here's an overall approach
- Spotify event script writes trackID to /tmp file
- PHP daemon polls the file for change in trackID (or use inotify in a BASH daemon)
---- If changed, scrape the website and cache the data somewhere
---- Send a message + data to the front-end via sendEngCmd()
- Front end receives the message + data and updates the WebUI (only for chromium/local display) with new metadata from the cache
- If page is refreshed re-load metadata from cache into WebUI
Something like that.