egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

shoutcast1.03.tcl problems

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
rubstar
Voice


Joined: 23 Apr 2006
Posts: 2

PostPosted: Tue Sep 09, 2008 7:32 am    Post subject: shoutcast1.03.tcl problems Reply with quote

hi,

i'm having some problems with the shoutcast.tcl script from domsen (shoutcast.tcl v1.03 by domsen <domsen@domsen.org>). His website is offline, and e-mails are not getting through, so asking the author is not possible.

My problems arrise with the !latest trigger, it collects the latest songs data from Shoutcast XML, and everything seems to be working, but the bot will not display the information on the channel.

When i did putlog "$songs" i can see data (artist - song) from 17 of the 20 songs in total, and the 17th song cuts off in the middle, it seems as if a variable can hold x amount of data or characters?

The code:

Code:
proc sclastsongs { target } {
global streamip streamport streampass
putlog "shoutcast: $target requested songhistory"
if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
putlog "error: $sockerror"
return 0 } else {
puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
puts $sock "Host: $streamip"
puts $sock "Connection: close"
puts $sock ""
flush $sock
while {[eof $sock] != 1} {
set bl [gets $sock]
if { [string first "standalone" $bl] != -1 } {
set songs [string range $bl [string first "<TITLE>" $bl] [expr [string last "</TITLE>" $bl] + 7]]

regsub -all "&#x3C;" $songs "<" songs
regsub -all "&#x3E;" $songs ">" songs
regsub -all "&#x26;" $songs "+" songs
regsub -all "&#x22;" $songs "\"" songs
regsub -all "&#x27;" $songs "'" songs
regsub -all "&#xFF;" $songs "" songs
regsub -all "<TITLE>" $songs "(" songs
regsub -all "</TITLE>" $songs ")" songs
regsub -all "<SONG>" $songs "" songs
regsub -all "</SONG>" $songs " - " songs
regsub -all "<PLAYEDAT>" $songs "" songs
regsub -all "</PLAYEDAT>" $songs "" songs
regsub -all {\d} $songs "" songs

regsub -all "&#xB4;" $songs "´" songs
regsub -all "&#x96;" $songs "-" songs
regsub -all "&#xF6;" $songs "ö" songs
regsub -all "&#xE4;" $songs "ä" songs
regsub -all "&#xFC;" $songs "ü" songs
regsub -all "&#xD6;" $songs "Ö" songs
regsub -all "&#xC4;" $songs "Ä" songs
regsub -all "&#xDC;" $songs "Ü" songs
regsub -all "&#xDF;" $songs "ß" songs

}}
close $sock
putserv "notice $target :$songs"
}}


Any ideas? thanks in advance..

[EDIT]

i kind of fixed it myself, i read somewhere you can only output 400 characters or something like that, so i've [string range] the song variable and it works now.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber