I created a script that utilizes Lyricsdrive.com to find a song based on some lyrics. This was my first attempt at Parsing / String Split to get useful information out of the raw HTML of a search. Please tell me what you think!
PS: I realize the results are not very accurate, but that is LyricsDrive's fault, and not mine. This script was just an experiment in Parsing/StringSplit, but may be useful too!
Press F1 for help.
Code:
;-----------------------------------
;|This script was made by TchnclFl,|
;|and is free to use, as long as |
;|you give credit if reposting! For|
;|help/instructions, press F1 while|
;|the script is running! |
;-----------------------------------
Gui, Show, x400 y188 h130 w291, Lyric Searcher
Gui, Add, Edit, vLyrics x0 y40 h20 w300 , Type up to 15 words from a song
Gui, Add, Button, Default x105 y80 h40 w80 , Search!
Gui, Add, Text, x110 y10 w250 h30 , Lyric Searcher
F1:: msgbox, Type up to 15 words into the search bar and press enter or
press "Search!" The more words, the more accurate the results will be.
Results are gathered from the database provided by
http://www.lyricsdrive.com.
F2:: run
http://www.lyricsdrive.com/search/?qr=%Word1%+%Word2%+%Word3%+%Word4%+%Wo
rd5%+%Word6%+%Word7%+%Word8%+%Word9%+%Word10%+%Word11%+%Word12%+%Word13%+
%Word14%+%Word15%
Esc:: ExitApp
Return
ButtonSearch!:
Gui, Submit, NoHide
StringSplit, Word, Lyrics, %A_Space%, %A_Space%
URLDownloadToFile,
http://www.lyricsdrive.com/search/?qr=%Word1%+%Word2%+%Word3%+%Word4%+%Wo
rd5%+%Word6%+%Word7%+%Word8%+%Word9%+%Word10%+%Word11%+%Word12%+%Word13%+
%Word14%+%Word15%, temp.txt
FileRead, Results, temp.txt
FileDelete, temp.txt
StringSplit, Song, Results, =, "
StringSplit, Reduced, Song43, ", %A_Space%
StringReplace, Final, Reduced1, Lyrics,, All
MsgBox, Best match based on provided lyrics: "%Final%"
Press F2 to see full results.
Return
GuiClose:
ExitApp
Direct Download (AHK)
Direct Download (EXE)