Lyrics Finder

By ^Neptune on Apr 30, 2009

Image

Woo. A "basic" lyrics searcher that can search different sites. Load the code in remotes and type /lyrics.

Instructions:

1) Input your song and artist for that song.
2) Select which site you want to search, then hit Go. That was hard.

According to what song you want lyrics for, you should try a different site. Usually, you'll get used to one specific site for your lyrics (like me). Here's a breakdown of what each site has:

azlyrics - an overall general lyrics site for stuff like pop and things on the radio.
lyricsbay - just another general one, so that you have two chances of finding what you want.
oldielyrics - use this for older artists, such as from the 70s and 80s, like donna summer, queen.. that kinda stuff.
plyrics - quite specialized, this. This site deals ONLY with punk music.
urbanlyrics - deals with R&B, Rap, Hip-Hop, Soul, Gospel and Soul music.
alivelyrics - another general site.

Extra stuff:
Last 50 searches - this was kind of an excuse to fill up space. But it's a nice little feature.
Auto-input for playing song - if you have a song playing in mIRC through /splay, the dialog will fill the artist and song name in the edit fields for you automatically.
Load/save lyrics - allows you to save/load lyrics so they can be quickly accessed on a later date or whatever.

..enjoy I guess.

Tested on 6.34 and 6.35.

Updates:
April 30th - added new site (alivelyrics.com)

dialog lyrics {
  title "Lyrics Finder"
  size -1 -1 368 236
  option dbu
  edit "", 1, 263 28 100 10, autohs center
  edit "", 2, 263 8 100 10, autohs center
  button "Go", 3, 263 58 100 10
  edit "", 4, 2 2 255 233, read multi vsbar center
  box "Song", 5, 260 0 106 20
  box "Artist", 6, 260 20 106 20
  box "", 7, 256 70 114 1
  list 8, 262 84 100 115, hsbar vsbar size
  text "Last 50 successful searches:", 9, 263 75 71 8
  box "", 10, 256 201 114 1
  check "Auto-input for playing song", 11, 272 208 100 8
  box "", 12, 256 219 114 1
  combo 13, 262 223 100 40, drop
  combo 14, 263 44 100 35, drop center sort
}
on *:dialog:lyrics:edit:*: {
  if ($did(lyrics,1).text) && ($did(lyrics,2).text) { did -e lyrics 3 }
  else { did -b lyrics 3 }
}
on *:dialog:lyrics:init:0: {
  did -b lyrics 3
  did -f lyrics 2
  didtok lyrics 13 124 Save lyrics|Load lyrics
  did -c lyrics 13 1
  didtok lyrics 14 124 azlyrics.com|plyrics.com|urbanlyrics.com|oldielyrics.com|lyricsbay.com|alivelyrics.com
  did -c lyrics 14 1
  if ($isfile($qt(lyrics\hist.txt))) { 
    loadbuf -o lyrics 8 $qt(lyrics\hist.txt)
    did -z lyrics 8  
  }
  if ($readini($qt(lyrics\config.ini),config,auto) == 1) { did -c lyrics 11 }
  if ($readini($qt(lyrics\config.ini),config,auto) == 1) && ($insong.fname) {
    if ($sound($insong.fname).artist) { did -a lyrics 1 $sound($insong.fname).artist }
    if ($sound($insong.fname).title) { did -a lyrics 2 $sound($insong.fname).title }
  }
}
alias htmlfree {  var %b,%p | %p = $regsub($1-,/[^<]*>|<[^>]*>|<[^>]*/g,$chr(32),%b) | %b = $remove(%b, )  | return %b }
alias nospace { return $remove($1-,$chr(32)) }
alias nospace2 { return $replace($1-,$chr(32),_) }
on *:dialog:lyrics:sclick:11: {
  if (!$isdir($qt(lyrics\))) { mkdir $qt(lyrics\) }
  if ($did(lyrics,11).state == 1) { writeini $qt(lyrics\config.ini) config auto 1 }
  elseif ($did(lyrics,11).state == 0) { remini $qt(lyrics\config.ini) config auto }
}
on *:dialog:lyrics:sclick:13: {
  if (!$isdir($qt(lyrics\lyrics\))) { mkdir $qt(lyrics\lyrics\) }
  if ($did(lyrics,13).sel == 1) {
    if ($did(lyrics,4).lines > 1) {
      var %sf = $?=\"What do you want to call the file?"
      savebuf -o lyrics 4 $qt(lyrics\lyrics\ $+ %sf $+ .txt)
      dialog -t lyrics Lyrics Finder - saved!
      .timer 1 2 dialog -t lyrics Lyrics Finder
    }
    elseif ($did(lyrics,4).lines == 1) { noop $input(There is nothing to save!,uwo,Error!) }
  }
  elseif ($did(lyrics,13).sel == 2) { 
    var %p = $sfile($qt(lyrics\lyrics\*.txt),Load lyrics)
    loadbuf -o lyrics 4  $qt(%p)
    did -z lyrics 8
  }
}
on *:dialog:lyrics:sclick:3: {
  did -r lyrics 4
  if ($did(lyrics,14).seltext == azlyrics.com) {
    if ($sock(lyrics)) { sockclose lyrics }
    sockopen lyrics www.azlyrics.com 80
  }
  elseif ($did(lyrics,14).seltext == oldielyrics.com) {
    if ($sock(nlyrics)) { sockclose nlyrics }
    sockopen nlyrics www.oldielyrics.com 80
  }
  elseif ($did(lyrics,14).seltext == plyrics.com) {
    if ($sock(plyrics)) { sockclose plyrics }
    sockopen plyrics www.plyrics.com 80 
  }
  elseif ($did(lyrics,14).seltext == urbanlyrics.com) {
    if ($sock(ulyrics)) { sockclose ulyrics }
    sockopen ulyrics www.urbanlyrics.com 80
  }
  elseif ($did(lyrics,14).seltext == lyricsbay.com) {
    if ($sock(mlyrics)) { sockclose mlyrics }
    sockopen mlyrics www.lyricsbay.com 80
  }
  elseif ($did(lyrics,14).seltext == alivelyrics.com) {
    if ($sock(alyrics)) { sockclose alyrics }
    sockopen alyrics www.alivelyrics.com 80
  }
  dialog -t lyrics Lyrics Finder - Searching...
}
on *:SOCKOPEN:lyrics: {
  var %lurl = $remove($lower($+(lyrics/,$remove($nospace($did(lyrics,1).text),/,.),/,$remove($nospace($did(lyrics,2).text),/,.),.html)),',$chr(44))
  sockwrite -n $sockname GET / $+ %lurl HTTP/1.0
  sockwrite -n $sockname Host: www.azlyrics.com $crlf $+ $crlf $+
}
on *:SOCKREAD:lyrics: {
  sockread %lyvar
  if ([ album lyrics ] isin %lyvar) {
    .signal nolyrics
    sockclose lyrics
  }
  elseif (<br> isin %lyvar) {
    did -a lyrics 4 $crlf $+ $htmlfree(%lyvar) 
    set %lsuc 1
  }
}
on *:SOCKCLOSE:lyrics: {
  if (%lsuc == 1) {
    clearlyrics
    addlyricshist
    dialog -t lyrics Lyrics Finder
    unset %lsuc
  }
}
alias clearlyrics {
  var %x = 1
  while (%x <= $did(lyrics,4).lines) {
    if (*READONLY>* iswm $did(lyrics,4,%x).text) { did -d lyrics 4 %x }
    if (*/font&* iswm $did(lyrics,4,%x).text) { did -d lyrics 4 %x }
    if (*lyricsbay.com* iswm $did(lyrics,4,%x).text) { did -d lyrics 4 %x }
    if (*</textarea>* iswm $did(lyrics,4,%x).text) { did -d lyrics 4 %x }
    if ([Thanks* iswm $did(lyrics,4,%x)) { did -d lyrics 4 %x }
    if ([Thanks* iswm $did(lyrics,4,%x)) { did -d lyrics 4 %x }     
    if (*azlyrics.com* iswm $did(lyrics,4,%x)) { did -d lyrics 4 %x }
    if (*album lyrics* iswm $did(lyrics,4,%x)) { did -d lyrics 4 %x }
    if (*LATEST SITE NEWS* iswm $did(lyrics,4,%x)) { did -d lyrics 4 %x }     
    if (*all lyrics are property and copyright* iswm $did(lyrics,4,%x)) { did -d lyrics 4 %x }
    if (*<textarea name=* iswm $did(lyrics,4,%x).text) { did -d lyrics 4 %x }
    inc %x
  }
  if ($did(lyrics,4,2).text === only.) { did -d lyrics 4 2 }
  if ($1 == n) {
    did -d lyrics 4 1
    did -d lyrics 4 1
    did -d lyrics 4 1
  }
}
alias lyrics { dialog $iif($dialog(lyrics),-v,-m) lyrics lyrics }
on *:SOCKOPEN:mlyrics: {
  var %murl = $remove($lower($+($nospace2($did(lyrics,2).text),_lyrics-,$nospace2($did(lyrics,1).text),.html)),')
  sockwrite -n $sockname GET / $+ %murl HTTP/1.0
  sockwrite -n $sockname Host: www.lyricsbay.com $crlf $+ $crlf $+
}
on *:SOCKREAD:mlyrics: {
  sockread %mlyrics
  if (<textarea name="songscpy isin %mlyrics) { 
    did -a lyrics 4 $htmlfree($replace(%mlyrics,<br />,$crlf,<br>,$crlf,f*ck,fuck)) 
    set %msuc 1
    dialog -t lyrics Lyrics Finder
  }
}
on *:SOCKCLOSE:mlyrics: {
  did -d lyrics 4 1
  did -d lyrics 4 1
  did -d lyrics 4 $did(lyrics,4).lines
  did -d lyrics 4 $did(lyrics,4).lines
  did -d lyrics 4 $did(lyrics,4).lines
  did -i lyrics 4 1 $crlf
  if (%msuc == 1) { addlyricshist }
  elseif (!%msuc) { .signal nolyrics }
  unset %msuc
}
on *:SOCKOPEN:plyrics: {
  var %purl = $remove($lower($+(lyrics/,$remove($nospace($did(lyrics,1).text),/,.),/,$remove($nospace($did(lyrics,2).text),/,.),.html)),',$chr(44))
  sockwrite -n $sockname GET / $+ %purl HTTP/1.0
  sockwrite -n $sockname Host: www.plyrics.com $crlf $+ $crlf $+
}
on *:SOCKREAD:plyrics: {
  sockread %plyrics
  if (Please check the spelling isin %plyrics) {
    .signal nolyrics 
    sockclose plyrics
  } 
  elseif (<br> isin %plyrics) {
    set %q 1  
    did -a lyrics 4 $crlf $+ $htmlfree(%plyrics) 
  }
}
on *:SOCKCLOSE:plyrics: {
  if (%q == 1) {
    addlyricshist
    unset %q
    did -i lyrics 4 1 $crlf    
  }
}
on *:SIGNAL:nolyrics: {
  dialog -t lyrics Lyrics Finder
  noop $input(No results were found.,uwo,Error!)
  did -r lyrics 4
}
on *:SOCKOPEN:ulyrics: {
  var %uurl = $remove($lower($+(lyrics/,$remove($nospace($did(lyrics,1).text),/,.),/,$remove($nospace($did(lyrics,2).text),/,.),.html)),',$chr(44))
  sockwrite -n $sockname GET / $+ %uurl HTTP/1.0
  sockwrite -n $sockname Host: www.urbanlyrics.com $crlf $+ $crlf $+
}
on *:SOCKREAD:ulyrics: {
  sockread %ulyrics
  if (<h2>404 error isin %ulyrics) {
    .signal nolyrics 
    sockclose ulyrics
  }
  elseif (<br> isin %ulyrics) {
    set %usuc 1
    if (*Ringtone to your Cell* iswm %ulyrics) { goto u }
    did -a lyrics 4 $crlf $+ $htmlfree(%ulyrics) 
  }
  :u
}
on *:SOCKCLOSE:ulyrics: { 
  if (%usuc == 1) { addlyricshist | unset %usuc }
}
alias addlyricshist {
  if (!$isdir($qt(lyrics\))) { mkdir $qt(lyrics\) }
  var %x = 1
  while (%x <= $lines($qt(lyrics\hist.txt))) {
    if ($read($qt(lyrics\hist.txt),%x) == $did(lyrics,2).text - $did(lyrics,1).text) { set %ly 1 }
    inc %x
  }
  if (%ly == 1) { unset %ly | halt }
  if ($lines($qt(lyrics\hist.txt)) == 100) { write -dl1 $qt(lyrics\hist.txt) }
  write -a $qt(lyrics\hist.txt) $did(lyrics,2).text - $did(lyrics,1).text
  did -r lyrics 8
  loadbuf -o lyrics 8 $qt(lyrics\hist.txt)
  did -z lyrics 8
}
on *:SOCKCLOSE:mlyrics: {
  did -d lyrics 4 1
  did -d lyrics 4 1
  did -d lyrics 4 1
  did -d lyrics 4 $did(lyrics,4).lines
  did -d lyrics 4 $did(lyrics,4).lines
  did -d lyrics 4 $did(lyrics,4).lines
  did -i lyrics 4 1 $crlf
}
on *:SOCKOPEN:nlyrics: {
  var %nurl = $remove($lower($+(lyrics/,$remove($nospace2($did(lyrics,1).text),/,.),/,$remove($nospace2($did(lyrics,2).text),/,.),.html)),',$chr(40),$chr(41))
  sockwrite -n $sockname GET / $+ %nurl HTTP/1.0
  sockwrite -n $sockname Host: www.oldielyrics.com $crlf $+ $crlf $+
}
on *:SOCKREAD:nlyrics: {
  sockread %nlyvar
  if (Browse Oldies Lyrics isin %nlyvar) {
    .signal nolyrics 
    sockclose nlyrics
  }
  elseif (<br> isin %nlyvar) {
    did -a lyrics 4 $crlf $+ $htmlfree(%nlyvar)
    set %nsuc 1   
  }
}
on *:SOCKCLOSE:nlyrics: {
  if (%nsuc == 1) {
    addlyricshist
    dialog -t lyrics Lyrics Finder
    unset %nsuc
  }
}
on *:SOCKOPEN:alyrics: {
  var %aurl = $remove($lower($+($left($remove($nospace($did(lyrics,1).text),/,.),1),/,$remove($nospace($did(lyrics,1).text),/,.),/,$remove($nospace($did(lyrics,2).text),/,.),.html)),',$chr(44))
  sockwrite -n $sockname GET / $+ %aurl HTTP/1.0
  sockwrite -n $sockname Host: www.alivelyrics.com $crlf $+ $crlf $+
}
on *:SOCKREAD:alyrics: {
  sockread %alyrics
  if (Featured albums: isin %alyrics) {
    .signal nolyrics 
    sockclose alyrics
  }
  if (<pre class="lyrics"> isin %alyrics) { set %ayes 1 }
  if (</pre> isin %alyrics) { unset %ayes }
  if ($chr(60) !isin %alyrics) { 
    if (%ayes == 1) { did -a lyrics 4 $crlf $+ %alyrics } 
    set %asuc 1
  }
}
on *:SOCKCLOSE:alyrics: { if (%asuc == 1) { addlyricshist | unset %asuc } }
on *:DIALOG:lyrics:close:0: { unset %*lyrics* }

Comments

Sign in to comment.
ProIcons   -  Jul 16, 2013

You can also have a single socket for all this different type of sockets, For example socketname lyrics.a lyrics.b lyrics.c
and handle them with on :sockopen:lyrics.:{
SO less code faster results

 Respond  
Hawkee   -  Jul 15, 2013

@^Neptune We got a request from Lyricsbay to remove them from your snippet. If you could oblige that would be great. Thank you!

 Respond  
alabama   -  Oct 20, 2011

neptune. can u help

 Respond  
Person   -  May 21, 2011

Nice, i like it, && the Lyrics example you used up there in the pic was a good choice too :D

 Respond  
Aurora801   -  Oct 18, 2009

Neptune: I know I'll just be told to do it myself, but would you mind helping me make a TEXT trigger for it? I am adding onto my bot, giving it Wiki/YouTube/Google/UrbanDictionary/Ect. searching, and Lyrics is on the list, could you possibly help me out on it some? I'm on several servers, PM me and I can give you more info?
My rating: 9.8/10 (I'd like it to have public use, but it's good as is)
Reason: I don't see any reason for it to get anything less than a 9.5!!

 Respond  
zNigel-   -  Jul 14, 2009

Very nice dialog m8. 10

 Respond  
blitzz   -  May 28, 2009

i like it ^Neptune, w'done. 7/10 but its a little bit slow. or maybe my connection caused it.

 Respond  
Jonesy44   -  May 27, 2009

nice one dude!

 Respond  
miniCruzer   -  May 27, 2009

Haha! I used to have a program like this for C++ and the CD it was on got scratched :(

 Respond  
xXLifelessxLoren__x   -  May 27, 2009

I love it.
10/10

 Respond  
rhasttaff   -  May 13, 2009

I Really Liked This!!!
Nice Idea and Work

10

Jah Bless!!!

 Respond  
montague   -  May 09, 2009

this script is kewl \m/

 Respond  
MsCAtrouble62   -  May 09, 2009

it wont let me load it :|

 Respond  
Anthrophobic   -  May 02, 2009

Rated : 10

It deserves it. Useful script for those radio listeners.

 Respond  
Aucun50   -  May 02, 2009

I like it looks and works professionally, i also like the save and different websites options.

The coding is abit mediocre but nice work. 4/10

As far as i can see this is very good coding, it's neat and very readable.

 Respond  
FordLawnmower   -  Apr 30, 2009

Very nice and useful script ^Neptune.

 Respond  
PATX   -  Apr 30, 2009

lol i gave a ten too!

 Respond  
PATX   -  Apr 30, 2009

rating: 10
reason: good script. good code. needs alt least a seven :)

 Respond  
Prelude   -  Apr 30, 2009

gave it a 10 just to get it to 7 or over;p where it should be.
Edit: back to a 7, well done nipples;p

 Respond  
PATX   -  Apr 30, 2009

lmao yeahi does not look bad to me...

 Respond  
^Neptune   -  Apr 30, 2009

Uh, thanks? =|

You're not exactly explaining to me why it's mediocre.

 Respond  
Slickone   -  Apr 30, 2009

The coding is abit mediocre but nice work. 4/10

 Respond  
PATX   -  Apr 30, 2009

woot! it works kinda0of-ly-ish :p good job.

 Respond  
^Neptune   -  Apr 30, 2009

It will display the lyrics of a given song.

Updated with a new site to the list.

 Respond  
throwing.star   -  Apr 30, 2009

whats it do?

 Respond  
^Neptune   -  Apr 30, 2009

Please note that a darklyrics socket is in the process of being made for all you metal/goth/screamo fans and stuff.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.