

dialog tv {
  icon icones/tv.ico
  title (Soir) Fais par Dj-Djé
  size -1 -1 300 370
  button "Fermer",1,5 345 290 20, cancel
  button "Voir Le Programme",2, 5 15 130 20
  edit "Attente De Connexion",3, 140 15 150 20, read
  box "",4, 5 55 290 275
  list 5, 10 65 280 280, multi, return, autovs, autohs, vsbar, hsbar

}

on *:dialog:tv:sclick:2:{
  sockopen tv www.cesoirtv.com 80
  did -ra tv 3 Connexion En Cours.....
}

on *:sockopen:tv:{
  if ($day = Monday) { sockwrite -n tv GET http://www.cesoirtv.com/fr/lundi.htm?time=1050009035548 } 
  if ($day = Tuesday) { sockwrite -n tv GET http://www.cesoirtv.com/fr/mardi.htm?time=1050009035548 } 
  if ($day = Wednesday) { sockwrite -n tv GET http://www.cesoirtv.com/fr/mercredi.htm?time=1050009035548 } 
  if ($day = Thursday) { sockwrite -n tv GET http://www.cesoirtv.com/fr/jeudi.htm?time=1050009035548 } 
  if ($day = Friday) { sockwrite -n tv GET http://www.cesoirtv.com/fr/vendredi.htm?time=1050009035548 } 
  if ($day = Saturday) { sockwrite -n tv GET http://www.cesoirtv.com/fr/samedi.htm?time=1050009035548 } 
  if ($day = Sunday) { sockwrite -n tv GET http://www.cesoirtv.com/fr/dimanche.htm?time=1050009035548 } 
}

on 1:sockread:tv:{
  if ($sockerr > 0) return
  :nextread
  sockread %temp
  did -ra tv 3 Connexion Effectué
  if ($sockbr == 0) return
  if (%temp == $null) %temp = -
  if (<b> isin %temp) && (href !isin $remove($gettok(%temp,1,60),b>)) && (h isin $remove($gettok(%temp,1,60),b>)) { did -a tv 5 $replace($remove($gettok(%temp,1,60),b>),&Agrave;,À,&egrave;,È,&Eacute;,É,&ocirc;,Ô,&ucirc;,Û,&ecirc;,Ê,&icirc;,Î,&#338;,Œ,&Ccedil;,Ç,&#339;,œ) }
  if ( <img src="tf1.gif" alt="TF1"> isin %temp ) { did -a tv 5 $chr(32) | did -a tv 5 Sur TF1 }
  if ( <img src="france2.gif" alt="FRANCE 2"> isin %temp ) { did -a tv 5 $chr(32) | did -a tv 5 Sur France 2 }
  if ( <img src="france3.gif" alt="FRANCE 3"> isin %temp ) { did -a tv 5 $chr(32) | did -a tv 5 Sur France 3 }
  if ( <img src="canalplus.gif" alt="CANAL PLUS"> isin %temp ) { did -a tv 5 $chr(32) | did -a tv 5 Sur Canal + }
  if ( <img src="arte.gif" alt="ARTE"> isin %temp ) { did -a tv 5 $chr(32) | did -a tv 5 Sur Arté }
  if ( <img src="m6.gif" alt="M6"> isin %temp ) { did -a tv 5 $chr(32) | did -a tv 5 Sur M6 }
  If ($chr(149) isin %temp) { did -a Ptv 4 1 $remove(%temp,$gettok(%temp,2,60),<</i,>) }
}
