• Resolved siamsa

    (@siamsa)


    Is there a way of updating more than one data field?

    In my case, I need to update 4 data fields (song title, artist, album title and album artwork) each time the audio track changes on an online radio station. The information changes approximately every 4 minutes and each of the 4 data fields changes each time.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author berkux

    (@berkux)

    Hi siamsa,

    sorry to write: This is not possible yet. I’ll add that to my “wished features” list.
    The thing you can do about it is to write a PHP script getting JSON, putting together the data you need and create a new JSON. Then you can use this new JSON with the Plugin. Like this: https://wptest.kux.de/extra/s.php

    PHP for that:

    <?php
      $j = file_get_contents("https://cast02.siamsa.ie/public/radio_siamsa/api/live/nowplaying/radio_siamsa");
      $jArr = json_decode($j, TRUE);
      $npSongArr = $jArr["now_playing"]["song"];
      $title = $npSongArr["title"];
      $ímg = "<img src=".$npSongArr["art"] ." align=left width=100>";
      $album = $npSongArr["album"];
      $artist = $npSongArr["artist"];
      
      $outArr{"out"} = $ímg.$title."<br>".$artist."<br>".$album;
      echo json_encode($outArr, JSON_UNESCAPED_SLASHES);
    ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Update more than one data field’ is closed to new replies.