More goodies I am working on... Anyone wanna contribute as I am just cobbling this together?
This will connect to the winamp songrequester plugin and show the songs on the first page to whoever types !playlist.
Will be working on adding functionality... Browse and request songs from within mirc interactively with songrequester.
Should use the newest version of Mirc.
This will connect to the winamp songrequester plugin and show the songs on the first page to whoever types !playlist.
Will be working on adding functionality... Browse and request songs from within mirc interactively with songrequester.
Should use the newest version of Mirc.
code:
on *:SOCKOPEN:http2: {
echo -s *** $sockname was just opened, Retrieving file
sockwrite -n $sockname GET /playlist.html HTTP/1.0
sockwrite -n $sockname User-Agent: Mozilla
sockwrite -n $sockname Host: radio.somnambulance.org
sockwrite $sockname $crlf
}
on *:SOCKCLOSE:http2: {
echo -s *** $sockname just closed
}
on *:SOCKREAD:http2: {
if ($sockerr > 0) {
echo 13 -a socketerror $sockerr
return
}
:nextread
sockread %temp
; read the data coming from the socket
if ($sockbr == 0) return
; if i've read all the data, stop
write c:\info.txt %temp
%idt1 = <tr><td colspan="3" width="100%" bgcolor="#C5C5C5"><p align="left"><a href="request.cgi?listpos=
%idt2 = "><font color="#000000" size="2" face="Tahoma">
%idt3 = </font></a></p></td></tr>
if (%idt1 isin %temp) {
inc %ct
%pos. [ $+ [ %ct ] ] = $gettok($remove(%temp,%idt1),1,34)
%poslen = $len(%pos. [ $+ [ %ct ] ] )
%songlen = $len($remtok($remove(%temp,%idt1,%idt2,%idt3),1,32))
%dif2 = %songlen - %poslen
%song. [ $+ [ %ct ] ] = $htmlfree($right($remtok($remove(%temp,%idt1,%idt2,%idt3),1,32),%dif2))
msg %reqr %ct - %song. [ $+ [ %ct ] ]
; echo 14 -a %ct - %song. [ $+ [ %ct ] ]
}
; if there was stuff received from the socket, then echo it
goto nextread
}
on 1:TEXT:!playlist:*: {
statopen2
%reqr = $nick
}
alias statopen2 {
sockopen http2 localhost 88
write -c c:\info.txt
%ct = 0
unset %pos.*
unset %pos2.*
unset %song.*
%poslen = 1
unset %songlen
unset %dif2
}
alias -l htmlfree {
; It's local because it won't be used by the command line, only this file.
; Local aliases avoid conflicting names.
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, 
return %x
}
Comment