Besoin d'aide pour TCL radionomy
#2
Voila un truc tout simple qui peut sûrement aller (pas testé):
tcl
bind pub - "!titre" radio:titre
 
set radio("#chan1") "6d854cc4-bb57-4339-b09f-2e5290a0bfda"
set radio("#chan2") "6d854cc4-bb57-4339-b09f-2e5290a0bfda"
 
package require http
proc radio:titre { nick uhost handle chan args } {
   if { ![info exists $::radio([string tolower $chan])] } { return 0 }
   set url [concat "http://api.radionomy.com/currentsong.cfm?radiouid=" $::radio([string tolower $chan]) "&apikey=" $::radio([string tolower $chan]) "&type=xml"]
   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"
}


Répondre


Messages dans ce sujet
RE: Besoin d'aide pour TCL radionomy - par CrazyCat - 23/05/2012, 21:42

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)
Tchat 100% gratuit -Discutez en toute liberté