Un peu d'aide svp.
#1
bonjour à tous. Tout d'abord merci d'avance pour vos reponses.

Voila je fait parti d'une radio web qui utilise un system IceCAST.
Le web master de ce site ne veux pas me filer les pass du serveur pour pouvoir utiliser un tcl de flux radio habituel.
Parcontre il ma fait un lien sur lequels le titre s'affiche (http://www.radio-wfm.com/infos.txt)
Pour vous dire je code peux le tcl et j'esseye de trouver une solution pour que le titre s'afiche. Alors j'ai ma petite idée sur la question Smile

moi je vois la trame du bot comme sa :

$fichier = open "url/fichier.txt";
$titre_en_cours = read $fichier;

if ($old_titre != $titre_en_cours) { afficher $titre_en_cours et $old_titre = $titre_en_cours }


C'est a dire, crée deux variable " hold titre" et "new-titre". Tout les 30 second le bot check le titre. Si le titre et toujours = au old titre rien ne s'afiche par contre si le titre est pas pareil il enregistre le titre et le difuse sur les salons.
Voila j'ai l'idée mais je sais pas comment le codé.
Merci de m'aider si c possible Smile
Répondre Avertir
#2
tcl
##########################
######### README #########
##########################

# This script is written by Sm0ke0ut.
# For shoutcast servers only!
# 
# Available Commands:
# !np !titre 		= Current Song
# !titre	!titre		= Stream Title/Current DJ
# !server			= Server Status
# !status			= Current Status of Stream (users/kbps)
# !record			= Listeners Peak
# !radio			= Get playlist
# !genre			= Shows Genre
# !website !site !url	= Shows url/site
# !icq			= ICQ Number
# !aim			= AIM Address
# !request <text>		= Request Song
#
# indeed, there's also `Stream IRC`, but that's pretty useless because you're already at IRC...
#
# irc.fayntic.com #fatalerrorgroup

##########################
######## Settings ########
##########################

# Stream URL (e.g. http://domain.tld:port OR http://IP:port)
set url "http://www.tonsite.com:8000"

# Playlist URL (Leave empty for default stream playlist)
set playlist "http://www.tonsite:8000/playlist.m3u"

# Public/User Channel
set streamch "#radio"

# Private/DJ Channel
set djch "#radio+"

##########################
###### DO NOT EDIT #######
##########################
 
package require http
 
bind pub -|- !titre get_shoutcast_song 
bind pub -|- !zik get_shoutcast_song 
proc get_shoutcast_song {nick uhost hand chan arg} {
   global url streamch
   set streamch [string tolower $streamch]
   ::http::config -useragent "Mozilla/5.0; Shoutinfo"
   if {[string tolower $chan] == "$streamch"} { 
   	set http_req [::http::geturl $url -timeout 2000]
	if {[::http::status $http_req] != "ok"} {
		puthelp "PRIVMSG $chan :Stream is unavailable";
	}
	set data [::http::data $http_req]
	::http::cleanup $http_req
	if {[regexp {<font class=default>Current Song: </font></td><td><font class=default><b>([^<]+)</b>} $data x title]} {
		puthelp "PRIVMSG $chan :\00212Musique En cours\002:13 $title"
	} else {
		puthelp "PRIVMSG $chan :Couldn't receive any information, checking server status..."
		get_shoutcast_server $nick $uhost $hand $chan $arg
	}
   }
}
 
bind pub -|- !onair get_shoutcast_title
bind pub -|- !onair get_shoutcast_title
proc get_shoutcast_title {nick uhost hand chan arg} {
   global url streamch
   set streamch [string tolower $streamch]
   ::http::config -useragent "Mozilla/5.0; Shoutinfo"
   if {[string tolower $chan] == "$streamch"} { 
   	set http_req [::http::geturl $url -timeout 2000]
	if {[::http::status $http_req] != "ok"} {
		puthelp "PRIVMSG $chan :Stream is unavailable";
	}
	set data [::http::data $http_req]
	::http::cleanup $http_req
	if {[regexp {<font class=default>Stream Title: </font></td><td><font class=default><b>([^<]+)</b>} $data x title]} {
		puthelp "PRIVMSG $chan :\00212On04-13Air \002:07 $title"
	} else {
		puthelp "PRIVMSG $chan :Couldn't receive any information, checking server status..."
		get_shoutcast_server $nick $uhost $hand $chan $arg
	}
   }
}
 
bind pub -|- !site get_shoutcast_site
bind pub -|- !url get_shoutcast_site
bind pub -|- !website get_shoutcast_site
proc get_shoutcast_site {nick uhost hand chan arg} {
   global url streamch
   set streamch [string tolower $streamch]
   ::http::config -useragent "Mozilla/5.0; Shoutinfo"
   if {[string tolower $chan] == "$streamch"} { 
   	set http_req [::http::geturl $url -timeout 2000]
	if {[::http::status $http_req] != "ok"} {
		puthelp "PRIVMSG $chan :Stream is unavailable";
	}
	set data [::http::data $http_req]
	::http::cleanup $http_req
	if {[regexp {>http://([^<]+)</a></b>} $data x title]} {
		puthelp "PRIVMSG $chan :\002Website\002: http://$title"
	} elseif {[regexp {>www.([^<]+)</a></b>} $data x title]} {
		puthelp "PRIVMSG $chan :\002Website\002: http://www.$title"
	} else {
		puthelp "PRIVMSG $chan :Couldn't receive any information, checking server status..."
		get_shoutcast_server $nick $uhost $hand $chan $arg
	}
   }
}
 
bind pub -|- !server get_shoutcast_server
proc get_shoutcast_server {nick uhost hand chan arg} {
   global url streamch
   set streamch [string tolower $streamch]
   ::http::config -useragent "Mozilla/5.0; Shoutinfo"
   if {[string tolower $chan] == "$streamch"} { 
   	set http_req [::http::geturl $url -timeout 2000]
	if {[::http::status $http_req] != "ok"} {
		puthelp "PRIVMSG $chan :Stream is unavailable";
	}
	set data [::http::data $http_req]
	::http::cleanup $http_req
	if {[regexp {<font class=default>Server Status: </font></td><td><font class=default><b>([^<]+)</b>} $data x title]} {
		puthelp "PRIVMSG $chan :\002Server\002: $title"
	} else {
		puthelp "PRIVMSG $chan :Couldn't contact the server, please check the configuration and/or streaming server"
	}
   }
}
 
bind pub -|- !genre get_shoutcast_genre 
proc get_shoutcast_genre {nick uhost hand chan arg} {
   global url streamch
   set streamch [string tolower $streamch]
   ::http::config -useragent "Mozilla/5.0; Shoutinfo"
   if {[string tolower $chan] == "$streamch"} { 
   	set http_req [::http::geturl $url -timeout 2000]
	if {[::http::status $http_req] != "ok"} {
		puthelp "PRIVMSG $chan :Stream is unavailable";
	}
	set data [::http::data $http_req]
	::http::cleanup $http_req
	if {[regexp {<font class=default>Stream Genre: </font></td><td><font class=default><b>([^<]+)</b>} $data x title]} {
		puthelp "PRIVMSG $chan :\002Genre\002: $title"
	} else {
		puthelp "PRIVMSG $chan :Couldn't receive any information, checking server status..."
		get_shoutcast_server $nick $uhost $hand $chan $arg
	}
   }
}
 
bind pub -|- !status get_shoutcast_status
proc get_shoutcast_status {nick uhost hand chan arg} {
   global url streamch
   set streamch [string tolower $streamch]
   ::http::config -useragent "Mozilla/5.0; Shoutinfo"
   if {[string tolower $chan] == "$streamch"} { 
   	set http_req [::http::geturl $url -timeout 2000]
	if {[::http::status $http_req] != "ok"} {
		puthelp "PRIVMSG $chan :Stream is unavailable";
	}
	set data [::http::data $http_req]
	::http::cleanup $http_req
	if {[regexp {B>([^<]+) of} $data x title]} {
		regexp { of ([^<]+) listeners} $data x title2
		regexp {listeners ([^<]+)} $data x title3
		regexp {Stream is up at ([^<]+) with} $data x title4
		puthelp "PRIVMSG $chan :\002Status\002: $title of $title2 $title3 at $title4"
	} else {
		puthelp "PRIVMSG $chan :Couldn't receive any information, checking server status..."
		get_shoutcast_server $nick $uhost $hand $chan $arg
	}
   }
}
 
 
 
bind pub -|- !radio get_shoutcast_listen
proc get_shoutcast_listen {nick uhost hand chan arg} {
   global url streamch playlist
   set streamch [string tolower $streamch]
   if {[string tolower $chan] == "$streamch"} {
	if {$playlist == ""} {
		puthelp "PRIVMSG $chan :\002Pour ecouter la radio www.tonlien.com"
	} else { 
		puthelp "PRIVMSG $chan :\002Pour ecouter la radio www.tonlien.com"
	}
   }
}
 
bind pub -|- !icq get_shoutcast_icq 
proc get_shoutcast_icq {nick uhost hand chan arg} {
   global url streamch
   set streamch [string tolower $streamch]
   ::http::config -useragent "Mozilla/5.0; Shoutinfo"
   if {[string tolower $chan] == "$streamch"} { 
   	set http_req [::http::geturl $url -timeout 2000]
	if {[::http::status $http_req] != "ok"} {
		puthelp "PRIVMSG $chan :Stream is unavailable";
	}
	set data [::http::data $http_req]
	::http::cleanup $http_req
	if {[regexp {<font class=default>Stream ICQ: </font></td><td><font class=default><b>([^<]+)</b>} $data x title]} {
		puthelp "PRIVMSG $chan :\002ICQ\002: $title"
	} else {
		puthelp "PRIVMSG $chan :Couldn't receive any information, checking server status..."
		get_shoutcast_server $nick $uhost $hand $chan $arg
	}
   }
}
 
bind pub -|- !aim get_shoutcast_aim 
proc get_shoutcast_aim {nick uhost hand chan arg} {
   global url streamch
   set streamch [string tolower $streamch]
   ::http::config -useragent "Mozilla/5.0; Shoutinfo"
   if {[string tolower $chan] == "$streamch"} { 
   	set http_req [::http::geturl $url -timeout 2000]
	if {[::http::status $http_req] != "ok"} {
		puthelp "PRIVMSG $chan :Stream is unavailable";
	}
	set data [::http::data $http_req]
	::http::cleanup $http_req
	if {[regexp {<font class=default>Stream AIM: </font></td><td><font class=default><b>([^<]+)</b>} $data x title]} {
		puthelp "PRIVMSG $chan :\002AIM\002: $title"
	} else {
		puthelp "PRIVMSG $chan :Couldn't receive any information, checking server status..."
		get_shoutcast_server $nick $uhost $hand $chan $arg
	}
   }
}



Voici un tcl assez complet de shoutcast sans demande de mots de passe , il affiche le titre quand on fait la commande !titre ou !zik mais ce n'est pas exactement ce que tu demande jespere que sa poura t'aider
Répondre
#3
re Smile merci pour ce tcl mais tu as mal lu au debut...
Le serveur est icecast...
Mais je vais regarder si sa marche ton truque ça ma l'air super interessan Smile
Répondre Avertir


Atteindre :


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