Radionomy Board
It is currently Thu Nov 21, 2019 8:03 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Api currentsong
PostPosted: Fri Oct 25, 2013 4:55 pm 
Offline
User avatar

Joined: Fri Oct 25, 2013 4:46 pm
Posts: 10
Location: 77700
Radio 1: http://hits-actu.fr/
O.S: Windows 8
Bonjour j'ai trouvé ce code sur internet, et j'aimerai savoir s'il peut blacklisté ma clé ?
Code:
<?
$srv_t = ''; ### 1 = Radionomy // 2 = SHOUTcast // 3 = Icecast ###
$uid_r = ''; ### Radio UID Radionomy ###
$srv_ip = ''; ### IP/URL du serveur ###
$srv_port = ''; ### PORT du serveur ###
$srv_mount = ''; ### MOUNT du serveur Icecast ###
$cache = './cache.txt'; ### Fichier de cache local ###
$cache_c = './cache_call.txt'; ### Fichier de cache_call local ###

##################################
#######  NE PAS MODIFIER ! #######
##################################
$date = '-1';
if($lines = file($cache_c)){$date = (isset($lines[1]) ? $lines[1] : '-1'); $time = $lines[0]; $expire = time() - $time;} else {$expire = time() - 1;}
if(@file_exists($cache) && $date > $expire && file_get_contents($cache) != ''){
$xml = @simplexml_load_file($cache);
$artist = trim($xml->track->artist);
$title = trim($xml->track->title);
$current = trim($xml->track->current);
$current_peak = trim($xml->track->current_peak);
$cover = trim($xml->track->cover);
} else {
@file_put_contents($cache_c, '200'."\n".time());
$context = stream_context_create(array('http' => array('timeout' => 3)));
touch($cache);
$xml = @file_get_contents('http://api.caramania.net/?srv_t='.$srv_t.'&uid_r='.$uid_r.'&srv_ip='.$srv_ip.'&srv_port='.$srv_port.'&srv_mount='.$srv_mount,0, $context);
if(!$xml){
$xml = @simplexml_load_file($cache);
} else {
@file_put_contents($cache, $xml);
$xml = @simplexml_load_file($cache);
$expire_n = ($xml->track->callmeback / 1000);
if($expire_n < 10) $expire_n = 30;
         @file_put_contents($cache_c, $expire_n."\n".time());
  }
$artist = trim($xml->track->artist);
$title = trim($xml->track->title);
$current = trim($xml->track->current);
$current_peak = trim($xml->track->current_peak);
$cover = trim($xml->track->cover);
}
##################################
?>


Etant donné qu'il ne demande pas la clé api je ne pense pas qu'il y ai de blacklistage à l'utilisation, mais je demande au cas ou !

Merci d'avance

_________________
Passionné d'aviation et d'informatique
Je me lance aujourd'hui dans la web radio !
Ma radio : http://hits-actu.fr


Top
 Profile Send private message  
 
 Post subject: Re: Api currentsong
PostPosted: Sat Oct 26, 2013 2:51 am 
Offline
Site Admin
User avatar

Joined: Mon Jun 24, 2013 9:17 am
Posts: 10089
Location: Planet Earth
Radio 1: http://www.radionomy.com/urbangold
Bonjour,

Dans la rubrique "Documentation", tu trouveras de nombreuses infos concernant les API.

Voici un lien utile : viewtopic.php?f=27&t=8#p8

Merci de ne pas oublier de compléter ta signature, avec notamment le lien vers ta radio. Indispendable à tout support ultérieur.

Bon WE

_________________
Domi

Avant toute question, cliquez-ici ! | Voir la F.A.Q. | Retrouvez vos messages

Before any question click here ! | Consult the F.A.Q. | Find your previous posts


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 26 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group