Bonjour,
CrazyCat avait posté un code fait par ces soins pour radionomy pour récupérer le titre et l'artiste diffusé.
J'ai chercher et rechercher, mais je ne trouve pas une chose.. comment actualité le titre tout seul sans taper "!titre" ( Tout ceux que j'ai modifié sa me faisait planter le TCL. )
Le code :
cordialement,[/b]
CrazyCat avait posté un code fait par ces soins pour radionomy pour récupérer le titre et l'artiste diffusé.
J'ai chercher et rechercher, mais je ne trouve pas une chose.. comment actualité le titre tout seul sans taper "!titre" ( Tout ceux que j'ai modifié sa me faisait planter le TCL. )
Le code :
tcl
bind pub - "!titre" radio:titre
set url "http://api.radionomy.com/currentsong.cfm?radiouid=6d854cc4-bb57-4339-b09f-2e5290a0bfda&apikey=6d854cc4-bb57-4339-b09f-2e5290a0bfda&type=xml"
package require http
proc radio:titre { nick uhost handle chan args } {
set page [::http::geturl $::url -timeout 3000]
set html [::http::data $page]
regexp -all -- {<title>(.+)?</title>} $html null title
regexp -all -- {<radioname>(.+)?</radioname} $html null radio
regexp -all -- {<artists>(.+)?</artists>} $html null artist
putserv "PRIVMSG $chan :En cours sur \002 .::. [htmlentities_decode $radio] .::. \002: \002[htmlentities_decode $title]\002 par \002[htmlentities_decode $artist]\002"
}
cordialement,[/b]