| View previous topic :: View next topic |
| Author |
Message |
TchnclFl
Joined: 29 Jul 2009 Posts: 48
|
Posted: Sat Aug 01, 2009 10:52 pm Post subject: Lyric Searcher |
|
|
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)
Last edited by TchnclFl on Mon Aug 03, 2009 6:29 pm; edited 1 time in total |
|
| Back to top |
|
 |
TchnclFl
Joined: 29 Jul 2009 Posts: 48
|
Posted: Sun Aug 02, 2009 4:01 am Post subject: |
|
|
Added direct AHK and EXE downloads for convenience . |
|
| Back to top |
|
 |
Bumblebee3
Joined: 31 Jul 2009 Posts: 11
|
Posted: Sun Aug 02, 2009 6:20 pm Post subject: |
|
|
| thanks another way to be lazy |
|
| Back to top |
|
 |
tidbit
Joined: 09 Mar 2008 Posts: 1807 Location: Minnesota, USA
|
Posted: Sun Aug 02, 2009 6:26 pm Post subject: |
|
|
btw: mediafire is not a convenience. any site that requires a wait is an annoyance
use http://www.autohotkey.net for AHK related files. _________________ rawr. be very afraid
*poke*
Note: My name is all lowercase for a reason.
Even monkeys fall from trees. - Japanese proverb |
|
| Back to top |
|
 |
TchnclFl
Joined: 29 Jul 2009 Posts: 48
|
Posted: Sun Aug 02, 2009 6:51 pm Post subject: |
|
|
| Good tip. But those links should be direct downloads...They are for me.. |
|
| Back to top |
|
 |
Bumblebee3
Joined: 31 Jul 2009 Posts: 11
|
Posted: Sun Aug 02, 2009 10:21 pm Post subject: |
|
|
| for me it was at most maby a second of waiting and thats because i have a slow ISP and loading most pages takes like 1/2 second, its really slow |
|
| Back to top |
|
 |
TchnclFl
Joined: 29 Jul 2009 Posts: 48
|
Posted: Sun Aug 02, 2009 10:22 pm Post subject: |
|
|
| Bumblebee3 wrote: | | for me it was at most maby a second of waiting and thats because i have a slow ISP and loading most pages takes like 1/2 second, its really slow |
Well, I designed it for my ISP, and you're welcome to edit the waiting to your needs. |
|
| Back to top |
|
 |
Bumblebee3unlogged in Guest
|
Posted: Mon Aug 03, 2009 6:16 am Post subject: |
|
|
| hard to tell sarcasm on the internet now that i think about it but it was prety fast though |
|
| Back to top |
|
 |
SoggyDog
Joined: 02 May 2006 Posts: 783 Location: Greeley, CO
|
Posted: Mon Aug 03, 2009 2:18 pm Post subject: |
|
|
| tidbit wrote: | btw: mediafire is not a convenience. any site that requires a wait is an annoyance
use http://www.autohotkey.net for AHK related files. |
Agreed. Mediafire is a pain in the @$$. These are so not direct links and I'm not sure how/why you'd think they were. Further, any site with pop-ups isn't worth my time. _________________
SoggyDog
Dwarf Fortress:
"The most intriguing game I've ever played." |
|
| Back to top |
|
 |
TchnclFl
Joined: 29 Jul 2009 Posts: 48
|
Posted: Mon Aug 03, 2009 4:23 pm Post subject: |
|
|
| SoggyDog wrote: | | tidbit wrote: | btw: mediafire is not a convenience. any site that requires a wait is an annoyance
use http://www.autohotkey.net for AHK related files. |
Agreed. Mediafire is a pain in the @$$. These are so not direct links and I'm not sure how/why you'd think they were. Further, any site with pop-ups isn't worth my time. |
I guess it's only for the owner then, because those are absolutely direct for me. |
|
| Back to top |
|
 |
Bumblebee3unlogged in Guest
|
Posted: Mon Aug 03, 2009 5:24 pm Post subject: |
|
|
| i almost didnt have to wait |
|
| Back to top |
|
 |
SoggyDog
Joined: 02 May 2006 Posts: 783 Location: Greeley, CO
|
Posted: Mon Aug 03, 2009 6:23 pm Post subject: Re: Lyric Searcher |
|
|
You postedwhich takes me to a MediaFire download page (complete with pop-ups).
On that page is a direct download linkwhich does immediately start the download.
I don't know how these links are generated by MediaFire nor if they are prone to change,
but maybe this will help sort out what links, as provided by MediaFire, are direct-to-download. _________________
SoggyDog
Dwarf Fortress:
"The most intriguing game I've ever played." |
|
| Back to top |
|
 |
TchnclFl
Joined: 29 Jul 2009 Posts: 48
|
Posted: Mon Aug 03, 2009 6:24 pm Post subject: |
|
|
| Well, in any rate, I'm going to go ahead and change those to AHK.net links. |
|
| Back to top |
|
 |
SoggyDog
Joined: 02 May 2006 Posts: 783 Location: Greeley, CO
|
Posted: Mon Aug 03, 2009 6:30 pm Post subject: |
|
|
| TchnclFl wrote: | | Well, in any rate, I'm going to go ahead and change those to AHK.net links. |
Probably a good idea.
All link issues aside, I like this script;
I'm constantly looking up lyrics to songs I hear;
Googleing is usually enough to do the job, but I'll give this a try for a while. _________________
SoggyDog
Dwarf Fortress:
"The most intriguing game I've ever played." |
|
| Back to top |
|
 |
TchnclFl
Joined: 29 Jul 2009 Posts: 48
|
Posted: Mon Aug 03, 2009 6:32 pm Post subject: |
|
|
| SoggyDog wrote: | | TchnclFl wrote: | | Well, in any rate, I'm going to go ahead and change those to AHK.net links. |
Probably a good idea.
All link issues aside, I like this script;
I'm constantly looking up lyrics to songs I hear;
Googleing is usually enough to do the job, but I'll give this a try for a while. |
Cool. Tell me how it works out . If there are any bugs, etc. Please tell me. |
|
| Back to top |
|
 |
|