Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
643
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 23.06 KB | None | 0 0
  1. # shoutcast.tcl v1.03 by domsen <domsen@domsen.org> (c)2oo5
  2. #
  3. # comments? bugs? ideas? requests? money? beer?
  4. # plz mail me or visit my homepage @ www.domsen.org
  5. # visit #newsticker@ircnet
  6. #
  7. #
  8. ###############################################################
  9. # shoutcast.tcl v1.03 by Chino <chino@canal-ayuda.org> (c)2oo6
  10. # "TCL con Permiso, Editado y Traducido con credito a domsen."
  11. #
  12. # Favor no tocar nada de lo que no entiendas de haber
  13. # algún problema no es responsabilidad mia ni de domsen
  14. #
  15. # Colores usados: Negro Azul Rojo Marrón y Fucsia
  16. #
  17. # Para cualquier ayuda me encuentra en:
  18. # < #Ayuda #Trujilo #Ayuda-Eggdrop > <eu.Undernet.oRG>
  19. #
  20. # No quitar los creditos dados a:
  21. #
  22. # - domsen
  23. # - Chino
  24. # - #Ayuda-Eggdrop
  25. #
  26. ###############################################################
  27. # Saludos:
  28. # A Spinetta que aportó mucho con la traducción.
  29. #
  30. ###############################################################
  31. # Configuracion ##################################################
  32.  
  33. set radiochans "#tcls #lapaz"
  34. set adminchans "#tcls"
  35. set streamip "radioirc.sytes.net"
  36. set streamport "8000"
  37. set streampass "Radiopass"
  38. set scstatstrigger "!estado"
  39. set scstreamtrigger "!enlace"
  40. set scplayingtrigger "!tocando"
  41. set sclistenertrigger "!oyentes"
  42. set scdjtrigger "!dj"
  43. set scsetdjtrigger ".serdj"
  44. set scunsetdjtrigger ".noserdj"
  45. set scwishtrigger "!pedidos"
  46. set scgreettrigger "!saludos"
  47. set sclastsongstrigger "!ultimas"
  48. set schelptrigger "!radio"
  49.  
  50.  
  51. set alertadmin ""
  52. set doalertadmin "1"
  53.  
  54. set announce "1"
  55.  
  56. set urltopic "0"
  57. set ctodjc "1"
  58. set tellsongs "1"
  59. set tellusers "1"
  60. set tellbitrate "1"
  61.  
  62. set advertise "1"
  63. set advertiseonlyifonline "1"
  64.  
  65. set offlinetext "La Radio Esta 4APAGADA !!!"
  66. set offlinetopic ""
  67.  
  68. set onlinetext "1Radio IRC 6TRANSMITIENDO a 4 /bitrate/ kbits 1Sitonizanos en -> 12http://$streamip:$streamport/listen.pls"
  69. set onlinetopic ""
  70.  
  71. set streamtext "Sintoniza Radio IRC en www.Sonidomegga.com"
  72.  
  73. set advertisetext "Radio IRC 4TRANSMITIENDO ---> 2 http://$streamip:$streamport/listen.pls - ... Para Ver Comandos de la Radio Teclea 2!radio "
  74.  
  75.  
  76. # end of config #####################
  77.  
  78.  
  79. bind pub - $scstatstrigger pub_scstat
  80. bind msg - $scstatstrigger msg_scstat
  81.  
  82. bind pub - $scplayingtrigger pub_playing
  83. bind msg - $scplayingtrigger msg_playing
  84.  
  85. bind pub - $scdjtrigger pub_dj
  86. bind msg - $scdjtrigger msg_dj
  87.  
  88. bind pub D $scsetdjtrigger pub_setdj
  89. bind msg D $scsetdjtrigger msg_setdj
  90.  
  91. bind pub D $scunsetdjtrigger pub_unsetdj
  92. bind msg D $scunsetdjtrigger msg_unsetdj
  93.  
  94. bind pub - $scwishtrigger pub_wish
  95. bind msg - $scwishtrigger msg_wish
  96.  
  97. bind pub - $scgreettrigger pub_greet
  98. bind msg - $scgreettrigger msg_greet
  99.  
  100. bind pub - $scstreamtrigger pub_stream
  101. bind msg - $scstreamtrigger msg_stream
  102.  
  103. bind pub - $sclastsongstrigger pub_lastsongs
  104. bind msg - $sclastsongstrigger msg_lastsongs
  105.  
  106. bind pub - $sclistenertrigger pub_listener
  107. bind msg - $sclistenertrigger msg_listener
  108.  
  109. bind pub - $schelptrigger pub_help
  110. bind msg - $schelptrigger msg_help
  111.  
  112. bind time - "* * * * *" envivo
  113. bind time - "?0 * * * *" advertise
  114. bind nick f * djnickchange
  115.  
  116.  
  117. set dj ""
  118. set surl ""
  119. set bitrate ""
  120. set stitle ""
  121.  
  122. if {[file exists dj]} {
  123. set temp [open "dj" r]
  124. set dj [gets $temp]
  125. close $temp
  126. }
  127.  
  128. proc shrink { calc number string start bl} { return [expr [string first "$string" $bl $start] $calc $number] }
  129.  
  130.  
  131. proc status { } {
  132. global streamip streamport streampass
  133. if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
  134. putlog "error: $sockerror"
  135. return 0 } else {
  136. puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
  137. puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
  138. puts $sock "Host: $streamip"
  139. puts $sock "Connection: close"
  140. puts $sock ""
  141. flush $sock
  142. while {[eof $sock] != 1} {
  143. set bl [gets $sock]
  144. if { [string first "standalone" $bl] != -1 } {
  145. set streamstatus [string range $bl [shrink + 14 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  146. }}
  147. close $sock
  148. }
  149. if { $streamstatus == "1" } { return 1 } else { return 0 }
  150. }
  151.  
  152.  
  153.  
  154.  
  155. proc poststuff { mode text } {
  156. global radiochans dj
  157. set curlist "0"
  158. set curhigh "0"
  159. set surl ""
  160. set cursong ""
  161. set sgenre ""
  162. set bitrate "0"
  163. set stitle ""
  164.  
  165. set temp [open "envivo" r]
  166. while {[eof $temp] != 1} {
  167. set zeile [gets $temp]
  168. if {[string first "curlist:" $zeile] != -1 } { set curlist $zeile }
  169. if {[string first "curhigh:" $zeile] != -1 } { set curhigh $zeile }
  170. if {[string first "cursong:" $zeile] != -1 } { set cursong [lrange $zeile 1 [llength $zeile]]] }
  171. if {[string first "sgenre:" $zeile] != -1 } { set sgenre [lrange $zeile 1 [llength $zeile]]}
  172. if {[string first "serverurl:" $zeile] != -1 } { set surl [lindex $zeile 1] }
  173. if {[string first "bitrate:" $zeile] != -1 } { set bitrate [lindex $zeile 1] }
  174. if {[string first "stitle:" $zeile] != -1 } { set stitle [lindex $zeile 1] }
  175. }
  176. close $temp
  177.  
  178. regsub -all "/stitle/" $text "$stitle" text
  179. regsub -all "/curlist/" $text "$curlist" text
  180. regsub -all "/curhigh/" $text "$curhigh" text
  181. regsub -all "/cursong/" $text "$cursong" text
  182. regsub -all "/sgenre/" $text "$sgenre" text
  183. regsub -all "/surl/" $text "$surl" text
  184. regsub -all "/bitrate/" $text "$bitrate" text
  185. regsub -all "/dj/" $text "$dj" text
  186.  
  187. foreach chan [channels] {
  188. if {$radiochans == "" } { putserv "$mode $chan :$text" }
  189. if {$radiochans != "" } {
  190. if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1)} {putserv "$mode $chan :$text"}
  191. }}}
  192.  
  193.  
  194. proc schelp { target } {
  195. global scstatstrigger scstreamtrigger scplayingtrigger scdjtrigger sclastsongstrigger scwishtrigger scgreettrigger sclistenertrigger
  196. putserv "notice $target :1Los Comandos Que Puede Usar Son:"
  197. putserv "notice $target :4$scstatstrigger1: Ver el Estado - 4$scstreamtrigger1: Ver Nuestro Link - 4$scplayingtrigger1: Ver el SONG que esta actualmente Sonando - 4$scdjtrigger1: Ver Nuestro Actual DJ de la Radio - 4$sclastsongstrigger1: Ver Las 10 ULTIMAS Song sonadas en radio - 4$scwishtrigger1: Mandar pedidos Musicales Ej: $scwishtrigger <tus_songs> - 4$scgreettrigger1: Mandar Tus Mensaje de Saludos Ej: $scgreettrigger <tus_saludos> 4$sclistenertrigger1: Ver N° Actual de Oyentes "
  198. putserv "notice $target :1Radio IRC ->> 5http://radioirc.sytes.net:8000/listen.pls51 - domsen & Chino"
  199. }
  200.  
  201.  
  202. proc pub_help {nick uhost hand chan arg} {
  203. global radiochans
  204. if {$radiochans == "" } { schelp $nick }
  205. if {$radiochans != "" } {
  206. if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { schelp $nick}
  207. }}
  208.  
  209. proc advertise { nick uhost hand chan arg } {
  210. global advertisetext advertise advertiseonlyifonline
  211. if {$advertise == "1" && $advertiseonlyifonline == "0"} { poststuff privmsg "$advertisetext" }
  212. if {$advertise == "1" && $advertiseonlyifonline == "1" && [status] == 1} { poststuff privmsg "$advertisetext" }
  213. }
  214.  
  215.  
  216. proc setdj {nickname djnickname } {
  217. if {$djnickname == "" } { set djnickname $nickname }
  218. global streamip streamport streampass dj
  219. putlog "shoutcast: Nuevo Dj: $djnickname ($nickname)"
  220. set temp [open "dj" w+]
  221. puts $temp $djnickname
  222. close $temp
  223. set temp [open "djnick" w+]
  224. puts $temp $nickname
  225. close $temp
  226. if { [status] == "1" } { poststuff privmsg "$djnickname Es Ahora Nuestro DJ."
  227. if { $::ctodjc == "1" } {
  228. set temp [open "envivo" r]
  229. while {[eof $temp] != 1} {
  230. set zeile [gets $temp]
  231. if {[string first "envivo:" $zeile] != -1 } { set oldenvivo $zeile }
  232. if {[string first "curlist:" $zeile] != -1 } { set oldcurlist $zeile }
  233. if {[string first "curhigh:" $zeile] != -1 } { set oldcurhigh $zeile }
  234. if {[string first "cursong:" $zeile] != -1 } { set oldsong $zeile }
  235. if {[string first "bitrate:" $zeile] != -1 } { set oldbitrate $zeile }
  236. }
  237. close $temp
  238. }
  239. } else {
  240. putserv "privmsg $nickname :Comando invalido por tener el servidor OFF Line" }
  241. }
  242.  
  243.  
  244. proc msg_setdj { nick uhost hand arg } { setdj $nick $arg }
  245. proc pub_setdj { nick uhost hand chan arg } { global adminchans; if {([lsearch -exact [string tolower $adminchans] [string tolower $chan]] != -1) || ($adminchans == "")} { setdj $nick $arg }}
  246.  
  247. proc unsetdj { nick } {
  248. global dj
  249. set dj ""
  250. file delete dj
  251. putserv "notice $nick :Dj Borrado .. Puede Entrar otro Dj Poniendo el Comando .setdj Nickname"
  252. }
  253.  
  254.  
  255.  
  256. proc msg_unsetdj { nick uhost hand arg } { unsetdj $nick }
  257. proc pub_unsetdj { nick uhost hand chan arg } { global adminchans; if {([lsearch -exact [string tolower $adminchans] [string tolower $chan]] != -1) || ($adminchans == "")} { unsetdj $nick }}
  258.  
  259.  
  260. proc listener { target } {
  261. global streamip streamport streampass
  262. putlog "Radio: $target Pedido De Conteo de Oyentes"
  263. if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
  264. putlog "error: $sockerror"
  265. return 0 } else {
  266. puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
  267. puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
  268. puts $sock "Host: $streamip"
  269. puts $sock "Connection: close"
  270. puts $sock ""
  271. flush $sock
  272. while {[eof $sock] != 1} {
  273. set bl [gets $sock]
  274. if { [string first "standalone" $bl] != -1 } {
  275. set repl [string range $bl [shrink + 19 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  276. set curhigh [string range $bl [shrink + 15 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  277. set maxl [string range $bl [shrink + 14 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  278. set avgtime [string range $bl [shrink + 13 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  279. }}
  280. close $sock
  281. putserv "notice $target :Actualmente hay $repl Oyente(s), La Radio Tiene Capacidad para $maxl Oyentes, el número máximo de Oyentes Hasta Ahora es de $curhigh Oyentes, el promedio de escucha es a $avgtime"
  282. }}
  283.  
  284. proc msg_listener { nick uhost hand arg } { listener $nick }
  285. proc pub_listener { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { listener $nick }}
  286.  
  287. proc wish { nick arg } {
  288. if {$arg == ""} { putserv "notice $nick :"; return 0}
  289. if { [status] == "1" } {
  290. set temp [open "djnick" r]
  291. set djnick [gets $temp]
  292. close $temp
  293. putserv "privmsg $djnick :PEDIDO MUSICAL: $arg de Parte de $nick"
  294. } else {
  295. putserv "notice $nick :" }
  296. }
  297.  
  298.  
  299. proc msg_wish { nick uhost hand arg } { wish $nick $arg }
  300. proc pub_wish { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { wish $nick $arg }}
  301.  
  302.  
  303.  
  304.  
  305. proc sclastsongs { target } {
  306. global streamip streamport streampass
  307. putlog "Radio: $target Pedidos las Song ultimas"
  308. if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
  309. putlog "error: $sockerror"
  310. return 0 } else {
  311. puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
  312. puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
  313. puts $sock "Host: $streamip"
  314. puts $sock "Connection: close"
  315. puts $sock ""
  316. flush $sock
  317. while {[eof $sock] != 1} {
  318. set bl [gets $sock]
  319. if { [string first "standalone" $bl] != -1 } {
  320. set songs [string range $bl [string first "<title>" $bl] [expr [string last "</title>" $bl] + 7]]
  321.  
  322. regsub -all "&#x3C;" $songs "<" songs
  323. regsub -all "&#x3E;" $songs ">" songs
  324. regsub -all "&#x26;" $songs "+" songs
  325. regsub -all "&#x22;" $songs "\"" songs
  326. regsub -all "&#x27;" $songs "'" songs
  327. regsub -all "&#xFF;" $songs "" songs
  328. regsub -all "<title>" $songs "(" songs
  329. regsub -all "</title>" $songs ")" songs
  330. regsub -all "" $songs "" songs
  331. regsub -all "" $songs " - " songs
  332. regsub -all "" $songs "" songs
  333. regsub -all "" $songs "" songs
  334. regsub -all {\d} $songs "" songs
  335.  
  336. regsub -all "&#xB4;" $songs "´" songs
  337. regsub -all "&#x96;" $songs "-" songs
  338. regsub -all "&#xF6;" $songs "ö" songs
  339. regsub -all "&#xE4;" $songs "ä" songs
  340. regsub -all "&#xFC;" $songs "ü" songs
  341. regsub -all "&#xD6;" $songs "Ö" songs
  342. regsub -all "&#xC4;" $songs "Ä" songs
  343. regsub -all "&#xDC;" $songs "Ü" songs
  344. regsub -all "&#xDF;" $songs "ß" songs
  345.  
  346.  
  347.  
  348. }}
  349. close $sock
  350. putserv "notice $target :$songs"
  351. }}
  352.  
  353.  
  354. proc msg_lastsongs { nick uhost hand arg } { sclastsongs $nick }
  355. proc pub_lastsongs { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { sclastsongs $nick }}
  356.  
  357.  
  358.  
  359. proc scstream { target } {
  360. global streamip streamport streamtext
  361. putlog "Radio: Informacion pedida por $target"
  362. putserv "notice $target :$streamtext"
  363. }
  364.  
  365. proc msg_stream { nick uhost hand arg } { scstream $nick }
  366. proc pub_stream { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { scstream $nick }}
  367.  
  368. proc scgreet { nick arg } {
  369. if {$arg == ""} { putserv "notice $nick :"; return 0}
  370. if { [status] == "1" } {
  371. set temp [open "djnick" r]
  372. set djnick [gets $temp]
  373. close $temp
  374. putserv "privmsg $djnick :(Saludo) - $nick - $arg"
  375. } else {
  376. putserv "notice $nick :" }
  377. }
  378.  
  379.  
  380. proc msg_greet { nick uhost hand arg } { scgreet $nick $arg }
  381. proc pub_greet { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { scgreet $nick $arg }}
  382.  
  383.  
  384.  
  385. proc djnickchange { oldnick uhost hand chan newnick } {
  386. set temp [open "djnick" r]
  387. set djnick [gets $temp]
  388. close $temp
  389. if {$oldnick == $djnick} {
  390. putlog "Radio: Cambia de Nick del Dj $oldnick -> $newnick"
  391. set temp [open "djnick" w+]
  392. puts $temp $newnick
  393. close $temp
  394. }}
  395.  
  396.  
  397.  
  398.  
  399.  
  400. proc dj { target } {
  401. global streamip streamport streampass dj
  402. putlog "Radio: $target pidio la Informacio de Dj"
  403. if {[status] == 1} {
  404. if {[file exists dj]} {
  405. set temp [open "dj" r]
  406. set dj [gets $temp]
  407. close $temp
  408. putserv "notice $target :Le Presento a 4$dj Nuestro(a) DJ de la Radio IRC"
  409. } else { putserv "notice $target :No hay ningun DJ seteado" }
  410. } else { putserv "notice $target :La Radio se encuentra OFF Line" }
  411. }
  412.  
  413.  
  414.  
  415.  
  416. proc msg_dj { nick uhost hand arg } { dj $nick"}
  417. proc pub_dj { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { dj $nick }}
  418.  
  419.  
  420.  
  421. proc scstat {target} {
  422. global streamip streamport streampass
  423. putlog "Radio: $target Pidio el Estado de la Radio"
  424. if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
  425. putlog "error: $sockerror"
  426. return 0 } else {
  427. puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
  428. puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
  429. puts $sock "Host: $streamip"
  430. puts $sock "Connection: close"
  431. puts $sock ""
  432. flush $sock
  433. while {[eof $sock] != 1} {
  434. set bl [gets $sock]
  435. if { [string first "standalone" $bl] != -1 } {
  436. set streamstatus [string range $bl [shrink + 14 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  437. set repl [string range $bl [shrink + 19 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  438. set curhigh [string range $bl [shrink + 15 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  439. set currentl [string range $bl [shrink + 18 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  440. set surl [string range $bl [shrink + 11 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  441. set maxl [string range $bl [shrink + 14 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  442. set bitrate [string range $bl [shrink + 9 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  443. set stitle [string range $bl [shrink + 13 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  444. set sgenre [string range $bl [shrink + 13 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  445. if {$sgenre != ""} {set sgenre " ($sgenre)"}
  446. set avgtime [string range $bl [shrink + 13 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  447. set irc [string range $bl [shrink + 5 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  448. set icq [string range $bl [shrink + 5 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  449. if {$icq == 0} { set icq "N/A" }
  450. set aim [string range $bl [shrink + 5 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  451. set webhits [string range $bl [shrink + 9 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  452. set streamhits [string range $bl [shrink + 12 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  453. set version [string range $bl [shrink + 9 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  454. if {$streamstatus == 1} {
  455. if {[file exists dj]} {
  456. set temp [open "dj" r]
  457. set dj [gets $temp]
  458. close $temp
  459. } else { set dj "none" }
  460. putserv "notice $target :Radio IRC ESTA EN LINEA, en shoutcast y Transmitiendo a $bitrate kbps, mas información en $surl"
  461. } else {
  462. putserv "notice $target :Radio IRC Actualmente ESTA APAGADA, Mas información en www.SonidoMegga.Com" }
  463. putserv "notice $target :La Capacidad maxima de oyentes es $maxl, Total de Oyentes En la Radio fue de $curhigh oyentes."
  464. putserv "notice $target :El tiempo promedio de escucha es de $avgtime segundos, La Radio tiene $webhits webhits y $streamhits streamhits."
  465. putserv "notice $target :Tu puedes contactarte en el IRC en el canal $irc, Via Internet."
  466. }}
  467. close $sock
  468. }}
  469.  
  470.  
  471. proc msg_scstat { nick uhost hand arg } { scstat $nick}
  472. proc pub_scstat { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { scstat $nick }}
  473.  
  474.  
  475. proc playing {target} {
  476. global streamip streamport streampass dj
  477. putlog "Radio: $target pidio el titulo de la Song"
  478. if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
  479. putlog "error: $sockerror"
  480. return 0 } else {
  481. puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
  482. puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
  483. puts $sock "Host: $streamip"
  484. puts $sock "Connection: close"
  485. puts $sock ""
  486. flush $sock
  487. while {[eof $sock] != 1} {
  488. set bl [gets $sock]
  489. if { [string first "standalone" $bl] != -1 } {
  490. set streamstatus [string range $bl [shrink + 14 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  491. set songtitle [string range $bl [shrink + 11 "set songurl [string range $bl [shrink + 9 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  492. if {$songurl != ""} { set songurl " ($songurl)"}
  493. regsub -all "&#x3C;" $songtitle "<" songtitle
  494. regsub -all "&#x3E;" $songtitle ">" songtitle
  495. regsub -all "&#x26;" $songtitle "+" songtitle
  496. regsub -all "&#x22;" $songtitle "\"" songtitle
  497. regsub -all "&#x27;" $songtitle "'" songtitle
  498. regsub -all "&#xFF;" $songtitle "" songtitle
  499. regsub -all "&#xB4;" $songtitle "´" songtitle
  500. regsub -all "&#x96;" $songtitle "-" songtitle
  501. regsub -all "&#xF6;" $songtitle "ö" songtitle
  502. regsub -all "&#xE4;" $songtitle "ä" songtitle
  503. regsub -all "&#xFC;" $songtitle "ü" songtitle
  504. regsub -all "&#xD6;" $songtitle "Ö" songtitle
  505. regsub -all "&#xC4;" $songtitle "Ä" songtitle
  506. regsub -all "&#xDC;" $songtitle "Ü" songtitle
  507. regsub -all "&#xDF;" $songtitle "ß" songtitle
  508.  
  509. if {$streamstatus == 1} {
  510. putserv "notice $target :Radio IRC, Tocando -> $songtitle"
  511. } else {
  512. putserv "notice $target :"
  513. }}}
  514. close $sock
  515. }}
  516.  
  517. proc msg_playing { nick uhost hand arg } { playing $nick}
  518. proc pub_playing { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { playing $nick }}
  519.  
  520.  
  521.  
  522. proc envivo { nick uhost hand chan arg } {
  523. global radiochans announce tellusers tellsongs tellbitrate urltopic dj
  524. global offlinetext offlinetopic onlinetext onlinetopic
  525. global streamip streampass streamport dj
  526. global doalertadmin alertadmin
  527.  
  528. if {$announce == 1 || $tellsongs == 1 || $tellusers == 1 || $tellbitrate == 1} {
  529. set envivofile "envivo"
  530. set oldenvivo "envivo: 0"
  531. set oldcurlist "curlist: 0"
  532. set oldcurhigh "curhigh: 0"
  533. set oldsong "cursong: 0"
  534. set oldbitrate "bitrate: 0"
  535. if {[file exists $envivofile]} {
  536. putlog "Radio: Viendo la Conexion de Radio"
  537. set temp [open "envivo" r]
  538. while {[eof $temp] != 1} {
  539. set zeile [gets $temp]
  540. if {[string first "envivo:" $zeile] != -1 } { set oldenvivo $zeile }
  541. if {[string first "curlist:" $zeile] != -1 } { set oldcurlist $zeile }
  542. if {[string first "curhigh:" $zeile] != -1 } { set oldcurhigh $zeile }
  543. if {[string first "cursong:" $zeile] != -1 } { set oldsong $zeile }
  544. if {[string first "bitrate:" $zeile] != -1 } { set oldbitrate $zeile }
  545. }
  546. close $temp
  547. }
  548.  
  549.  
  550. if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
  551. putlog "error: $sockerror"
  552. return 0} else {
  553. puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
  554. puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
  555. puts $sock "Host: $streamip"
  556. puts $sock "Connection: close"
  557. puts $sock ""
  558. flush $sock
  559. while {[eof $sock] != 1} {
  560. set bl [gets $sock]
  561. if { [string first "standalone" $bl] != -1 } {
  562. set streamstatus "envivo: [string range $bl [shrink + 14 "" 0 $bl] [shrink - 1 "" 0 $bl]]"
  563. set repl "curlist: [string range $bl [shrink + 19 "" 0 $bl] [shrink - 1 "" 0 $bl]]"
  564. set curhigh "curhigh: [string range $bl [shrink + 15 "" 0 $bl] [shrink - 1 "" 0 $bl]]"
  565. set currentl [string range $bl [shrink + 18 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  566. set surl "serverurl: [string range $bl [shrink + 11 "" 0 $bl] [shrink - 1 "" 0 $bl]]"
  567. set cursong "cursong: [string range $bl [shrink + 11 "<songtitle" 0 $bl] [shrink - 1 "" 0 $bl]]"
  568. set songurl [string range $bl [shrink + 9 "" 0 $bl] [shrink - 1 "" 0 $bl]]
  569. set bitrate "bitrate: [string range $bl [shrink + 9 "" 0 $bl] [shrink - 1 "" 0 $bl]]"
  570. set stitle "stitle: [string range $bl [shrink + 13 "" 0 $bl] [shrink - 1 "" 0 $bl]]"
  571. set sgenre "sgenre: [string range $bl [shrink + 13 "" 0 $bl] [shrink - 1 "" 0 $bl]]"
  572. }}
  573. close $sock
  574. }
  575.  
  576. set temp [open "envivo" w+]
  577. puts $temp "$streamstatus\n$repl\n$curhigh\n$cursong\n$bitrate\n$stitle\n$sgenre\n$surl"
  578. close $temp
  579. if {$announce == 1 } {
  580. if {$streamstatus == "envivo: 0" && $oldenvivo == "envivo: 1"} {
  581. poststuff privmsg $offlinetext
  582. if {$doalertadmin == "1"} { sendnote domsen $alertadmin "" }
  583. if {$urltopic == 1} { poststuff topic $offlinetopic }
  584. }
  585. if {$streamstatus == "envivo: 1" && $oldenvivo == "envivo: 0" } {
  586. if {$sgenre != ""} {
  587. set sgenre " ([lrange $sgenre 1 [llength $sgenre]] )"
  588. }
  589. poststuff privmsg "$onlinetext"
  590. if {$urltopic == 1} { poststuff topic "$onlinetopic" }
  591. }}
  592. if {($tellusers == 1) && ($streamstatus == "envivo: 1") && ($oldcurhigh != "curhigh: 0") } {
  593. if {$oldcurhigh != $curhigh} {
  594. poststuff privmsg "Posibles Oyentes: [lindex $curhigh 1]"
  595. }
  596. if {$oldcurlist != $repl} {
  597. poststuff privmsg ""
  598. }}
  599. if {($tellsongs == 1) && ($oldsong != $cursong) && ($streamstatus == "envivo: 1") } {
  600. if {$songurl != ""} { set songurl " ($songurl)"}
  601. regsub -all "&#x3C;" $cursong "<" cursong
  602. regsub -all "&#x3E;" $cursong ">" cursong
  603. regsub -all "&#x26;" $cursong "+" cursong
  604. regsub -all "&#x22;" $cursong "\"" cursong
  605. regsub -all "&#x27;" $cursong "'" cursong
  606. regsub -all "&#xFF;" $cursong "" cursong
  607. regsub -all "&#xB4;" $cursong "´" cursong
  608. regsub -all "&#x96;" $cursong "-" cursong
  609. regsub -all "&#xF6;" $cursong "ö" cursong
  610. regsub -all "&#xE4;" $cursong "ä" cursong
  611. regsub -all "&#xFC;" $cursong "ü" cursong
  612. regsub -all "&#xD6;" $cursong "Ö" cursong
  613. regsub -all "&#xC4;" $cursong "Ä" cursong
  614. regsub -all "&#xDC;" $cursong "Ü" cursong
  615. regsub -all "&#xDF;" $cursong "ß" cursong
  616. putlog $cursong
  617. poststuff privmsg "1Quieres Escuchar La Radio IRC Haz Doble Click en ->> 12 http://radioirc.sytes.net:8000/listen.pls En Linea 6$dj...La Actual Canción es: 4 [lrange $cursong 1 [llength $cursong]] .. Para Ver Comandos de la Radio Teclea 6!radio "
  618. }
  619.  
  620. if {($tellbitrate == 1) && ($oldbitrate != $bitrate) && ($streamstatus == "envivo: 1") && ($oldbitrate != "bitrate: 0")} {
  621. poststuff privmsg "Calidad Seteada a [lindex $bitrate 1]kbps"
  622. }}}
  623.  
  624. putlog "-= Cargado: shoutcast.tcl Por *#Ayuda-eggdrop* =-"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement