Plugin Author
berkux
(@berkux)
Hi,
try
[jsoncontentimporter url=https://cast02.siamsa.ie/public/radio_siamsa/api/live/nowplaying/radio_siamsa basenode=now_playing.song] {text}<img src={art}> [/jsoncontentimporter]
Every time the wordpress-page is called (unless it is cached by a caching-plugin) the shortcode is executed, the URL retrieved and the info displayed.
Bernhard
Thread Starter
siamsa
(@siamsa)
Thanks for that Bernhard. This will certainly retrieve the data once the url is retrieved.
However, in my scenario, the user leaves the page open to listen to an audio stream. The endpoint data changes about every 3 minutes as the audio track changes. But the data displayed by the jsoncontentimporter template doesn’t update to reflect the changed track data – it keeps the same data as when the url was initially retrieved.
Is there any way to poll the endpoint and update the displayed data when a change is detected?
I came across your other plugin “Auto Refresh API Ajax”, but I’m not sure that the two plugins integrate, or how they can be integrated.
Plugin Author
berkux
(@berkux)
Thread Starter
siamsa
(@siamsa)
Thanks again Bernhard.
Further question – does this permit only 1 data field (eg, song title) to be updated?
In my case, I need to update 4 data fields (song title, artist, album title and album artwork) each time the audio track changes.
Plugin Author
berkux
(@berkux)
Hi, switch to the support of this plugin, please:
https://wordpress.org/plugins/auto-refresh-api-ajax/
Bernhard
-
This reply was modified 6 years, 5 months ago by
berkux.