• Welcome to RadioDJ - Free Radio Automation Software Forum. Please log in or sign up.

SOLVED: How do i get now playing info like "Online Radio Box" does?

Started by PresidentOfACPJ, December 21, 2022, 01:24:14 AM

PresidentOfACPJ

Hi guys, how can i get artist - title from icecast server like Online Radio Box do:


They just have  the stream link, no mountpoint, no passwoird, no port, but they get artist and title information, and they ount top 10 songs played on that station and last songs played, not only now paying song.

How do i make it?
KBMZ RADIO:

radiorockfm.com.br/
twitter: @radiorockfmreal/
fb: @radiorockfmreal

studioflashback.com.br
twitter: @radiosflashback
fb: @radiostudioflashback

BR The Classic Rock:
radiorockfm.com.br/br
twitter. @classicrockbr
fb: @classicrockbr

ZTOP:
radiorockfm.com.br/ztop
twitter: @ztop
fb: @ztop

PresidentOfACPJ

i FOUNT THE WAY, BY USING AN api THAT I FOUND IN gITHUB:

i CREATED some functions and now i can use it to get my zeno media stations metadata, so , i dont need to get it from radiodj database, if server falls, this keep showing, im workin on a playing page to show artist image, biography, lyrics, last songs, and current song. maybe some extra info about songs playing too. When it be ready, ill come back to post it here.


https://api.streamafrica.net/zeno/index.php?z=gzf0stmb2d0uv

You change this, inserting your:

YOU CAN FIND IT HERE:



The way that you also can get your zeno media station metadata easily is here below:
<?php
/*
TO GET DATA FROM CURRENT SONGS PLAYING IN ZENO MEDIA:


(PASTE IN BROWSER TO SEE THE DATA.
THEN JUST GET THE DATA WITH PHP, JAVASCRIPT OR OTHER LANGUAGE)

AFTER OPENING THE ABOVE LINK ON YOUR BROWSER, THESE DATA WILL BE SHOWN:

{"currentSong":"High Hopes","currentArtist":"Panic! at the Disco","songHistory":[{"artist":"Luke Combs","song":"Forever After All"},{"artist":"Rosa Linn","song":"Snap (Armenia)"},{"artist":"radio top! top! top!","song":""},{"artist":"Lil Baby & Drake","song":"Yes Indeed"},{"artist":"Post Malone feat. Ty Dolla $ign","song":"Psycho"}]}

THIS WITHOUT THE DATA:
{"currentSong":"","currentArtist":"","songHistory":[{"artist":"","song":""},{"artist":"","song":""},{"artist":"","song":""},{"artist":"","song":""},{"artist":"","song":""}]}

*/


$url 'https://api.streamafrica.net/zeno/index.php?z=gzf0stmb2d0uv';
$data json_decode(file_get_contents($url), true);
$currentSong $data['currentSong'];
$currentArtist $data['currentArtist'];

$songHistory $data 'songHistory' ];


//echo $currentSong . "<br>";
//echo $currentArtist . "<br>". "<br>";

//var_dump($songHistory);          //  VER O CONTEƚDO DO ARRAY EM FORMATO DE ARRAY INDENTADO.
//echo json_encode($songHistory);   VER EM IDENTICO AO DO LINK COLADO NO NAVEGADOR.
/*
echo $songHistory [ 0 ]['artist'] . "<br>";
echo $songHistory [ 0 ]['song'] . "<br>";
echo $songHistory [ 1 ]['artist'] . "<br>";
echo $songHistory [ 1 ]['song'] . "<br>";
echo $songHistory [ 2 ]['artist'] . "<br>";
echo $songHistory [ 2 ]['song'] . "<br>";
echo $songHistory [ 3 ]['artist'] . "<br>";
echo $songHistory [ 3 ]['song'] . "<br>";
echo $songHistory [ 4 ]['artist'] . "<br>";
echo $songHistory [ 4 ]['song'] . "<br>";

*/


Now you just have to get this data shown by echo, then handle it as you wish.This API shows last 5 songs played, and current song playing.
KBMZ RADIO:

radiorockfm.com.br/
twitter: @radiorockfmreal/
fb: @radiorockfmreal

studioflashback.com.br
twitter: @radiosflashback
fb: @radiostudioflashback

BR The Classic Rock:
radiorockfm.com.br/br
twitter. @classicrockbr
fb: @classicrockbr

ZTOP:
radiorockfm.com.br/ztop
twitter: @ztop
fb: @ztop

bankuboy

hey, i built that metadata API. :) what are the features you want me to add next

QuanahReed

You can usually find this information about instagram promotion in the subtitles or on the song information page.

arkhangeluz

Greetings Imperials!

I saw a post of yours.
it's about radio met data metadata radio

https://api.streamafrica.net/zeno/index.php?z=gzf0stmb2d0uv

I request if possible the source code to study

PresidentOfACPJ

Quote from: bankuboy on April 30, 2023, 11:26:46 PMhey, i built that metadata API. :) what are the features you want me to add next
Serious, so you created that! Great job! Man, i would like to have a script that could see the last not 5, but 30 songs player on the stream, zeno media or not. Im working on a new project, and working hard with my new best friends ever Phind, Gemini and Chat GGP, lol. It helps a lot.

So that API just get the 5 last songs played, itll be usefull more songs to be shown.
KBMZ RADIO:

radiorockfm.com.br/
twitter: @radiorockfmreal/
fb: @radiorockfmreal

studioflashback.com.br
twitter: @radiosflashback
fb: @radiostudioflashback

BR The Classic Rock:
radiorockfm.com.br/br
twitter. @classicrockbr
fb: @classicrockbr

ZTOP:
radiorockfm.com.br/ztop
twitter: @ztop
fb: @ztop