Lyrics-Finder — File Browser
Lyrics-Finderv1.0 / Lyrics-Finderv1.0 / Lyricsfinder.mrc
Lyricsfinder.mrc — 18.64 KB — Download this file
on *:LOAD:{ echo 5 -a Type /lyricdialog or right click on a channel background and select 'Lyrics Finder' }
menu menubar,channel,query,nicklist,dcc,status {
-
Lyrics Finder:lyricdialog
-
}
alias lyricdialog {
dialog -dm lyrics lyrics
}
dialog lyrics {
title "Lyrics-Finder"
size -1 -1 297 230
option dbu
box "", 1, 1 0 295 229
box "Search", 2, 5 5 152 32
combo 3, 8 13 115 42, size edit drop
button "Search", 4, 126 13 27 10, default
box "Search Results", 5, 5 38 107 174
list 6, 8 46 101 153, size
box "Lyrics", 7, 115 38 177 174
edit "", 8, 118 46 170 153, read multi autovs vsbar
button "Save Lyrics", 9, 119 201 35 8
text "Status: Ready", 10, 6 215 228 8
radio "Scattered Words", 12, 73 27 51 8
check "Alphabetical", 13, 9 200 40 10
button "Close", 14, 254 215 37 10, ok
text "Lyrics-Finder - Powered By: ", 15, 163 11 70 12, center
box "", 16, 160 5 132 32
link "LyricsTime", 18, 260 10 30 8
link "LyricsSpot", 19, 260 28 30 8
menu "File", 20
item "Clear search list", 21, 20
check "Search lyric content", 23, 9 26 56 9
radio "Phrase", 24, 126 27 27 8
link "LeosLyrics", 25, 260 19 30 8
}
alias lyrics {
sockclose lyrics
dialog -t lyrics Lyrics-Finder
unset %result
unset %backup
write -c Lyricssongs.txt
did -r lyrics 6
did -r lyrics 8
did -a lyrics 10 Status: Connecting...
.timerBACKUP 1 4 backuplyric | set %backup 1
sockopen lyrics www.lyricstime.com 80
}
on *:sockopen:lyrics:{
sockwrite -n $sockname GET /artist/ $+ %lyric.name HTTP/1.1
sockwrite -n $sockname Host: www.lyricstime.com
sockwrite -n $sockname Connection: close
sockwrite -n $sockname $crlf
}
on *:sockread:lyrics:{
if ($sockerr) {
echo -a Error.
}
else {
var %temptext
sockread %temptext
.timerBACKUP off
did -a lyrics 10 Status: Getting Song Names...
if (*<a title="* iswm %temptext) && (*</a><br>* iswm %temptext) && (*a d v e r t i s m e n t* !iswm %temptext) { write Lyricssongs.txt $replace($nohtml($remove(%temptext,$chr(10),$chr(13))),$chr(32),-) $iif($findnum($nohtml($remove(%temptext,$chr(10),$chr(13)))),$gettok($findnum($remove(%temptext,$chr(10),$chr(13))),2,32),$findnum($remove(%temptext,$chr(10),$chr(13)))) | write lyricstemp.txt $nohtml($remove(%temptext,$chr(10),$chr(13))) }
}
}
on *:sockclose:lyrics:{
if ($read(lyricstemp.txt)) {
if ($did(Lyrics,13).state == 1) {
did -a lyrics 10 Status: Sorting Song Names...
sortlist "lyricstemp.txt" "lyricstemp2.txt"
did -a lyrics 10 Status: Listing...
var %i 0
while (%i <= $calc($lines(lyricstemp2.txt) + 1)) {
inc %i
if (%i == $lines(lyricstemp2.txt)) { did -c lyrics 6 1 | .remove lyricstemp.txt | .remove lyricstemp2.txt | did -a lyrics 10 Status: Ready | halt }
if ($read(lyricstemp2.txt,%i) !isin %temp.lyric) && (*href* !iswm $read(lyricstemp2.txt,%i)) && (*<* !iswm $read(lyricstemp2.txt,%i)) && (*=* !iswm $read(lyricstemp2.txt,%i)) { did -a lyrics 6 $replace($read(lyricstemp2.txt,%i),',') }
set %temp.lyric $read(lyricstemp2.txt,%i)
}
}
else {
var %i 0
while (%i <= $calc($lines(lyricstemp.txt) + 1)) {
inc %i
if (%i == $lines(lyricstemp.txt)) { did -c lyrics 6 1 | did -a Lyrics 10 Status: Ready | .remove lyricstemp.txt | halt }
if ($read(lyricstemp.txt,%i) !isin %temp.lyric) && (*href* !iswm $read(lyricstemp.txt,%i)) && (*<* !iswm $read(lyricstemp.txt,%i)) && (*=* !iswm $read(lyricstemp.txt,%i)) { did -a lyrics 6 $replace($read(lyricstemp.txt,%i),',') }
set %temp.lyric $read(lyricstemp.txt,%i)
}
}
}
set %lyric.name $replace(%lyric.name,-,+)
set %backup 1
unset %temp.lyric
backuplyric
}
alias backuplyric {
sockclose backuplyrics
dialog -t lyrics Lyrics-Finder
write -c Lyricssongs.txt
did -r lyrics 6
did -r lyrics 8
did -a lyrics 10 Status: Trying backup site...
set %lyric.name $replace(%lyric.name,-,+)
sockopen backuplyrics www.lyricsspot.com 80
}
on *:sockopen:backuplyrics:{
sockwrite -n $sockname GET /artists.php?l= $+ %lyric.name HTTP/1.1
sockwrite -n $sockname Host: www.lyricsspot.com
sockwrite -n $sockname Connection: close
sockwrite -n $sockname $crlf
}
on *:sockread:backuplyrics:{
if ($sockerr) {
echo -a Error.
}
else {
var %temptext
sockread %temptext
if ($replace(%lyric.name,+,$chr(32)) !isin %temptext) && (*<a href* !iswm %temptext) && (!%result) { set %found.nothing 1 }
if ($replace(%lyric.name,+,$chr(32)) isin %temptext) && (*<a href* iswm %temptext) {
if ($remove($nohtml(%temptext),$chr(32))) { set %link.to.next. [ $+ [ $remove($nohtml(%temptext),$chr(32)) ] ] $gettok(%temptext,2,34) }
if ($remove($nohtml(%temptext),$chr(32))) { inc %result }
if ($nohtml(%temptext)) && (*document.* !iswm $nohtml(%temptext)) { did -a lyrics 6 $remove($nohtml(%temptext),$chr(9),$chr(10),$chr(13)) | did -a lyrics 3 $remove($nohtml(%temptext),$chr(9),$chr(10),$chr(13)) }
unset %found.nothing
unset %receiving.temp
}
}
}
on *:sockclose:backuplyrics:{
if (%found.nothing == 1) {
did -a Lyrics 10 Status: Your search returned no results
.timer 1 2 did -a Lyrics 10 Status: Ready
unset %found.nothing
unset %link.to.next*
unset %result
halt
}
if (%result == 1) {
write -c Lyricssongs.txt
did -c lyrics 3 $did(lyrics,3).lines
set %link.to.next $eval($var(%link.to.next.*,1),2)
did -r lyrics 6
sockclose backuplyrics2
sockopen backuplyrics2 www.lyricsspot.com 80
}
}
on *:sockopen:backuplyrics2:{
sockwrite -n $sockname GET / $+ $replace($remove(%link.to.next,$gettok(%link.to.next,-1,38),&),album.php,songs.php) HTTP/1.1
sockwrite -n $sockname Host: www.lyricsspot.com
sockwrite -n $sockname Connection: close
sockwrite -n $sockname $crlf
}
on *:sockread:backuplyrics2:{
if ($sockerr) {
echo -a Error.
}
else {
var %temptext
sockread %temptext
if (*<a href="song.php?* iswm %temptext) { set %songname $findnum($remove(%temptext,$chr(9))) }
if (*</a><br>* iswm %temptext) { set %songname %songname $remove(%temptext, </a><br>) | write Lyricssongs.txt $remove(%songname,$gettok(%songname,1,32)) $gettok(%songname,1,32) | write lyricstemp.txt $remove(%songname,$gettok(%songname,1,32)) | unset %songname }
}
}
on *:sockclose:backuplyrics2:{
if ($read(lyricstemp.txt)) {
if ($did(Lyrics,13).state == 1) {
did -a lyrics 10 Status: Sorting Song Names...
sortlist "lyricstemp.txt" "lyricstemp2.txt"
did -a lyrics 10 Status: Listing...
var %i 0
while (%i <= $calc($lines(lyricstemp2.txt) + 1)) {
inc %i
if (%i == $lines(lyricstemp2.txt)) { did -c lyrics 6 1 | .remove lyricstemp.txt | .remove lyricstemp2.txt | did -a lyrics 10 Status: Ready | unset %link.to.next.* | halt }
if ($read(lyricstemp2.txt,%i) !isin %temp.lyric) && (*href* !iswm $read(lyricstemp2.txt,%i)) && (*<* !iswm $read(lyricstemp2.txt,%i)) && (*=* !iswm $read(lyricstemp2.txt,%i)) { did -a lyrics 6 $replace($read(lyricstemp2.txt,%i),',') }
set %temp.lyric $read(lyricstemp2.txt,%i)
}
}
else {
var %i 0
while (%i <= $calc($lines(lyricstemp.txt) + 1)) {
inc %i
if (%i == $lines(lyricstemp.txt)) { did -a lyrics 6 $read(lyricstemp.txt,%i) | did -c lyrics 6 1 | did -a Lyrics 10 Status: Ready | .remove lyricstemp.txt | unset %link.to.next.* | halt }
if ($read(lyricstemp.txt,%i) !isin %temp.lyric) && (*href* !iswm $read(lyricstemp.txt,%i)) && (*<* !iswm $read(lyricstemp.txt,%i)) && (*=* !iswm $read(lyricstemp.txt,%i)) { did -a lyrics 6 $replace($read(lyricstemp.txt,%i),',') }
set %temp.lyric $read(lyricstemp.txt,%i)
}
}
}
unset %link.to.next
unset %link.to.next.*
unset %temp.lyric
unset %lyric.name
did -a Lyrics 10 Status: Your search returned no results
.timer 1 2 did -a Lyrics 10 Status: Ready
}
on *:dialog:lyrics:menu:21:{
write -c $shortfn($scriptdirRecentlyrics.txt)
did -r lyrics 3
}
on *:dialog:lyrics:init:0:{
var %i 0
while (%i < $lines(Recentlyrics.txt)) {
inc %i
did -a lyrics 3 $read(Recentlyrics.txt,%i)
}
did -c Lyrics 13
did -b lyrics 24
did -b lyrics 12
}
on *:dialog:lyrics:sclick:11:{
dialog -dm search search
}
on *:dialog:lyrics:sclick:18:{
url www.lyricstime.com
}
on *:dialog:lyrics:sclick:19:{
url www.lyricsspot.com
}
on *:dialog:lyrics:sclick:25:{
url www.leoslyrics.com
}
on *:dialog:lyrics:sclick:23:{
if ($did(lyrics,24).enabled == $true) {
did -u lyrics 24
did -u lyrics 12
did -b lyrics 24
did -b lyrics 12
}
if ($did(lyrics,23).state == 1) {
did -e lyrics 24
did -e lyrics 12
did -c lyrics 24
}
}
on *:dialog:lyrics:sclick:9:{
set %fileplace $shortfn($sdir(C:/,Place to save lyrics to?))
mkdir %fileplace $+ lyrics
if ($exists(%fileplace $+ lyrics $+ \ $+ $remove($dialog(lyrics).title,Lyrics-Finder,$chr(32),$chr(40),$chr(41),:) $+ .txt) == $true) { halt }
var %i 0
while (%i < $did(lyrics,8).lines) {
inc %i
write %fileplace $+ lyrics $+ \ $+ $remove($dialog(lyrics).title,Lyrics-Finder,$chr(32),$chr(40),$chr(41),:) $+ .txt $did(lyrics,8,%i)
}
unset %fileplace
}
on *:sockclose:lyrics:{
if ($did(lyrics,6).lines == 0) { did -r lyrics 6 | did -a lyrics 10 Status: Your search returned no results | .timer 1 2 did -a Lyrics 10 Status: Ready | halt }
did -r lyrics 8
did -c Lyrics 20
}
on *:dialog:lyrics:sclick:14:{
dialog -x lyrics lyrics
lyrics.deletefile
}
on *:dialog:lyrics:close:0:{
unset %lyric.*
unset %temp.lyric
unset %result
unset %receive.from.site
lyrics.deletefile
}
on *:dialog:lyrics:dclick:6:{
if (%lyricfind == 1) {
write -c lyricssongs.txt
dialog -t lyrics Lyrics-Finder ( $+ $did(lyrics,6).seltext $+ )
did -r lyrics 8
set %link.song $gettok($read(TempLyrics.txt,w,* $+ $did(Lyrics,6).seltext $+ *),-1,32)
lyricfind3
halt
}
if (%link.to.next. [ $+ [ $remove($did(lyrics,6).seltext,$chr(32)) ] ]) {
if (%result > 1) {
write -c Lyricssongs.txt
did -a lyrics 3 $did(lyrics,6).seltext
did -c lyrics 3 $did(lyrics,3).lines
set %link.to.next %link.to.next. [ $+ [ $remove($did(lyrics,6).seltext,$chr(32)) ] ]
unset %link.to.next.*
did -r lyrics 6
sockclose backuplyrics2
sockopen backuplyrics2 www.lyricsspot.com 80
}
halt
}
if (%backup == 1) {
set %lyric.song $gettok($read(Lyricssongs.txt,w,* $+ $did(Lyrics,6).seltext $+ *),-1,32)
dialog -t lyrics Lyrics-Finder ( $+ $did(lyrics,3) - $did(lyrics,6).seltext $+ )
lyricsong2
halt
}
dialog -t lyrics Lyrics-Finder ( $+ $did(lyrics,3) - $did(lyrics,6).seltext $+ )
set %lyric.song $gettok($read(Lyricssongs.txt,w,* $+ $lower($replace($did(lyrics,6).seltext,$chr(32),-)) $+ *),-1,32)
lyricsong
}
on *:dialog:lyrics:sclick:4:{
unset %lyricfind
if ($did(lyrics,23).state == 1) {
dialog -t lyrics Lyrics-Finder
set %lyricfind 1
lyricfind
halt
}
if ($len($did(lyrics,3)) >= 3) {
set %lyric.name $lower($replace($did(lyrics,3),$chr(32),-))
var %i 0
if ($didwm(lyrics,3,* $+ $did(lyrics,3) $+ *) == 0) { did -a lyrics 3 $did(lyrics,3) | write Recentlyrics.txt $did(lyrics,3) }
lyrics
}
else {
did -a Lyrics 10 Status: Search length must be at least 3 characters
.timer 1 2 did -a Lyrics 10 Status: Ready
}
}
alias lyricfind {
sockclose lyricfind
did -r lyrics 8
did -r lyrics 6
write -c lyricstemp.txt
write -c templyrics.txt
set %lyric.song $replace($did(lyrics,3),$chr(32),+)
did -a lyrics 10 Status: Connecting...
sockopen lyricfind www.leoslyrics.com 80
}
on *:sockopen:lyricfind:{
sockwrite -n $sockname GET /lyricsearch.php;jsessionid=98B13E612C77D5F7CCA4BAC7A5D89970?search= $+ %lyric.song $+ &mode= $+ $iif($did(lyrics,24).state == 1,phrase,$null) $+ $iif($did(lyrics,12).state == 1,scatter,$null) HTTP/1.1
sockwrite -n $sockname Host: www.leoslyrics.com
sockwrite -n $sockname Connection: close
sockwrite -n $sockname $crlf
}
on *:sockread:lyricfind:{
if ($sockerr) {
echo -a Error.
}
else {
var %temptext
sockread %temptext
did -a lyrics 10 Status: Getting Song Names...
if (<a href="/artists/ isin $remove(%temptext,$chr(9))) { set %temp.artist.name $nohtml(%temptext) }
if (<a href="/listlyrics isin $remove(%temptext,$chr(9))) { write TempLyrics.txt %temp.artist.name - $gettok($replace($remove(%temptext,$chr(9),<a href=",<b>,</b>,</a>,"),>,$chr(32),',',&,&,","),2-500,32) $gettok($replace($remove(%temptext,$chr(9),<a href=",<b>,</b>,</a>,"),>,$chr(32),',',&,&,","),1,32) | write lyricstemp.txt %temp.artist.name - $gettok($replace($remove(%temptext,$chr(9),<a href=",<b>,</b>,</a>,"),>,$chr(32),',',&,&,","),2-500,32) }
}
}
on *:sockclose:lyricfind:{
if ($read(lyricstemp.txt)) {
if ($did(Lyrics,13).state == 1) {
did -a lyrics 10 Status: Sorting Song Names...
sortlist "lyricstemp.txt" "lyricstemp2.txt"
did -a lyrics 10 Status: Listing...
var %i 0
while (%i <= $calc($lines(lyricstemp2.txt) + 1)) {
inc %i
if (%i == $lines(lyricstemp2.txt)) { did -a lyrics 6 $replace($read(lyricstemp2.txt,%i),',') | did -c lyrics 6 1 | .remove $shortfn($scriptdirlyricstemp.txt) | .remove lyricstemp2.txt | did -a lyrics 10 Status: Ready | unset %link.to.next.* | halt }
if ($read(lyricstemp2.txt,%i) !isin %temp.lyric) && (*href* !iswm $read(lyricstemp2.txt,%i)) && (*<* !iswm $read(lyricstemp2.txt,%i)) && (*=* !iswm $read(lyricstemp2.txt,%i)) { did -a lyrics 6 $replace($read(lyricstemp2.txt,%i),',',&,&,",") }
set %temp.lyric $read(lyricstemp2.txt,%i)
}
}
else {
var %i 0
while (%i <= $calc($lines(lyricstemp.txt) + 1)) {
inc %i
if (%i == $lines(lyricstemp.txt)) { did -a lyrics 6 $read(lyricstemp.txt,%i) | did -c lyrics 6 1 | did -a Lyrics 10 Status: Ready | .remove lyricstemp.txt | unset %link.to.next.* | halt }
if ($read(lyricstemp.txt,%i) !isin %temp.lyric) && (*href* !iswm $read(lyricstemp.txt,%i)) && (*<* !iswm $read(lyricstemp.txt,%i)) && (*=* !iswm $read(lyricstemp.txt,%i)) { did -a lyrics 6 $replace($read(lyricstemp.txt,%i),',',&,&,",") }
set %temp.lyric $read(lyricstemp.txt,%i)
}
}
}
unset %temp.lyric
unset %lyric.song
did -a Lyrics 10 Status: Your search returned no results
.timer 1 2 did -a Lyrics 10 Status: Ready
}
alias lyricfind3 {
sockclose lyricfind3
sockopen lyricfind3 www.leoslyrics.com 80
did -a Lyrics 10 Status: Receiving lyrics...
}
on *:sockopen:lyricfind3:{
sockwrite -n $sockname GET %link.song HTTP/1.1
sockwrite -n $sockname Host: www.leoslyrics.com
sockwrite -n $sockname Connection: close
sockwrite -n $sockname $crlf
}
on *:sockread:lyricfind3:{
if ($sockerr) {
echo -a Error.
}
else {
var %temptext
sockread %temptext
if (<p align="center"> isin %temptext) || (<p align="ce isin %temptext) { set %receive.lyrics.lyricsong 0 }
if (%receive.lyrics.lyricsong == 1) { did -a lyrics 8 $replace($remove(%temptext,$chr(10),$chr(13),</p>),',',",",<br />,$crlf) }
if (<font face="Trebuchet MS, Verdana, Arial" size=-1> isin %temptext) { set %receive.lyrics.lyricsong 1 }
}
}
on *:sockclose:lyricfind3:{
did -c lyrics 8 1
if ($did(lyrics,8).lines == 1) {
did -a lyrics 8 Unable to get lyrics
}
did -a lyrics 10 Status: Ready
}
alias lyricsong2 {
sockclose lyricsong
did -r lyrics 8
unset %allow.receive.lyric
did -a lyrics 10 Status: Receiving Lyrics...
sockopen lyricsong2 www.lyricsspot.com 80
}
on *:sockopen:lyricsong2:{
sockwrite -n $sockname GET /song.php?s= $+ %lyric.song HTTP/1.1
sockwrite -n $sockname Host: www.lyricsspot.com
sockwrite -n $sockname Connection: close
sockwrite -n $sockname $crlf
}
on *:sockread:lyricsong2:{
if ($sockerr) {
echo -a Error.
}
else {
var %temptext
sockread %temptext
if (*</font></td>* iswm %temptext) && (%receive.from.site == 2) { did -a Lyrics 8 $nohtml(%temptext) | did -a lyrics 8 $crlf | set %receive.from.site 0 }
if (%receive.from.site == 2) && (<br> isin %temptext) || (<br /> isin %temptext) { did -a lyrics 8 $nohtml(%temptext) | did -a lyrics 8 $crlf }
if (*<td><h3>* iswm %temptext) && (%receive.from.site == 1) { set %receive.from.site 2 }
if (*<table width="90%" border="0" cellspacing="0" cellpadding="0">* iswm %temptext) { set %receive.from.site 1 }
}
}
on *:sockclose:lyricsong2:{
if ($did(lyrics,8).lines == 1) { did -a lyrics 8 Unable to get lyrics }
did -a lyrics 10 Status: Ready
did -c lyrics 8 1
unset %lyric.song
}
alias lyricsong {
sockclose lyricsong
did -r lyrics 8
unset %allow.receive.lyric
did -a lyrics 10 Status: Receiving Lyrics...
sockopen lyricsong www.lyricstime.com 80
}
on *:sockopen:lyricsong:{
sockwrite -n $sockname GET /lyrics/ $+ %lyric.song $+ .html HTTP/1.1
sockwrite -n $sockname Host: www.lyricstime.com
sockwrite -n $sockname Connection: close
sockwrite -n $sockname $crlf
}
on *:sockread:lyricsong:{
if ($sockerr) {
echo -a Error.
}
else {
var %temptext
sockread %temptext
if (</p><br><br> isin %temptext) { unset %allow.receive.lyric | halt }
if (%allow.receive.lyric == 1) { did -a lyrics 8 $nohtml(%temptext) | did -a lyrics 8 $crlf | halt }
if (<p> isin %temptext) && (<br /> isin %temptext) { set %allow.receive.lyric 1 | did -a lyrics 8 $nohtml(%temptext) | did -a lyrics 8 $crlf }
}
}
on *:sockclose:lyricsong:{
if ($did(lyrics,8).lines == 1) { did -a lyrics 8 Unable to get lyrics }
did -a lyrics 10 Status: Ready
did -c lyrics 8 1
unset %lyric.song
}
alias -l lyrics.deletefile {
if ($exists($+(",$scriptdirLyricssongs.txt,"))) .remove $+(",$scriptdirLyricssongs.txt,"))
}
alias sortlist {
var %x = $+(",$gettok($1-,1,34),")
var %y = $+(",$gettok($1-,3,34),")
if (!%x) { echo -a $+(,$color(info text),*) /sortlist: insufficient parameters | return }
var %w = @sortlist
if ($window(%w)) { window -c %w }
window -hs %w
loadbuf -l %w %x
savebuf %w $iif(%y,%y,%x)
window -c %w
}
alias findnum {
if ($isid) {
var %i 0
unset %toreturn
while (%i < $regex($1-,/(\d{1 $+ $chr(44) $+ 100})/g)) {
inc %i
set %toreturn %toreturn $regml(%i)
}
return %toreturn
}
}
alias nohtml {
var %tmp, %ignore = $regsub($1-,/(<[^>]+>)/g,$chr(32),%tmp)
return %tmp
}