Public feed
#887999
alias lyrics {
if (!$1) { echo $color(info) -ta Please specify a song to search. }
else {
sockopen lyrics seek.sing365.com 80
sockmark lyrics $replace($1-,$chr(32),$+(%,20))
}
}
on *:Sockopen:lyrics:{
sockwrite -nt lyrics GET /cgi-bin/s.cgi?cs=utf-8&im=p&o=1&iq= $+ $sock(lyrics).mark $+ &xm=w&xq=&ps=10&btnG=Go+Search%21 HTTP/1.1
sockwrite -nt lyrics Host: seek.sing365.com
sockwrite -nt lyrics $crlf
}
on *:sockread:lyrics: {
if $sockerr { echo $color(info) -ta Socket error, closed connection. }
else {
var %s
sockread %s
if (Sorry, but search returned no results. isin %s) {
echo $color(info) -ta No results found.
sockclose $sockname
}
if (<small class=gr> isin %s) {
sockopen lyrics2 www.sing365.com 80
sockmark lyrics2 $remove($nohtml(%s),http://www.sing365.com)
sockclose $sockname
}
}
}
on *:sockopen:lyrics2: {
sockwrite -nt lyrics2 GET $sock(lyrics2).mark HTTP/1.1
sockwrite -nt lyrics2 Host: www.sing365.com
sockwrite -nt lyrics2 $crlf
}
on *:sockread:lyrics2: {
if (!$window(@lyrics)) {
window @lyrics
}
if ($sockerr) { halt }
else {
var %s
sockread %s
if (<hr size=1 color=#cccccc> isin %s) {
unset %g %l
echo $color(info) @lyrics Lyrics finished
sockclose $sockname
}
if (%g) {
if ($nohtml(%s)) {
echo $color(info) @lyrics $v1
}
}
if (</TABLE> isin %s) {
inc %l
if (%l = 2) {
set %g 1
}
}
}
}
alias nohtml return $regsubex($1-,/<[^>]+>/g,)