Ruby Lyric Parser 1.2

James Gleeson chocomoojuice at gmail.com
Sat Aug 9 21:00:43 CEST 2008


Name: Ruby Lyric Parser
Version: 1.2
Type: Amarok Script
Depend: 
License: Creative Commons by
Homepage: 
More Info:
http://www.kde-apps.org/content/show.php?content=86602

Description:
 -- About --
RLP is a lyric fetching script for Amarok written
in Ruby.

The RLP philosophy:
1) Keep the number of search engines to a minimum.
2) Use the best search engines.
3) Search effectively and efficiently.

Search Engines (in order of search priority):
1) LyricWiki - a reliable, well-maintained, and
constantly updated lyric site
2) JustSomeLyrics - good for less popular music
(not found on LyricWiki)

__Basic Search Algorithm Description__
Processing Artist/Song Data:
1) Artist and song data are first "processed";
this involves stripping any useless/junk
characters that would otherwise prevent useful
search results.
2) Original artist and song data are still
preserved.  In the event that a search with the
processed info fails, we'll try it again but with
the unprocessed data.
3) Adding to 2)... RLP will retry only if the
following conditions hold true:
	a) The processed and unprocessed song information
differs
	b) retry is set to true in configuration options
	c) The search method itself is set to retry (as
defined by me)

LyricWiki Search Methods:
1) Guess the url:  This method "guesses" the url
from the song/artist data.  So, if the meta tags
on your music are accurate, then you'll have no
problems getting lyrics.
2) Google search: This method searches google
using the song/artist data and grabs the first
search result.

JustSomeLyrics Search Methods:
1) Google search: This method searches google
using the song/artist data and grabs the first
search result.

-- Benefits of RLP --
1) I actively develop and constantly test my code
(see the Test Cases suite I've included in
lyric_parser.rb).
2) The general trend with lyrics scripts seems to
be:
"more search engines = better results"
I disagree, and instead believe:
"more search engines = bloated and slow script
that searches ineffectively"
3) I'm open to suggestions (see Contact
information below).

-- Configuration --
The configuration is located at the top of
lyric_parser.rb, and is quite minimal (and in my
opinion, not needed).

-- Dependencies --
Ruby 1.8 (ruby1.8)
Standard Ruby Libraries (libruby1.8)
kdebase-bin (for error notifications)

-- Contact --
Having trouble getting lyrics for a song even
though it's on one of the above search engines?
Know a better lyric search engine that I should
include in future releases?

By all means, email me about it, and I'll consider
implementing it.
Email: chocomoojuice at gmail.com

Changelog:
 Version 1.2
Date: Saturday, August 9th, 2008
> Fixed a bug where library files I made (page.rb,
lyric_parser_implementations.rb) were showing up
in the script manager [thanks to pejakm for
pointing that out]
> Gave an html makeover to the About information
> Changed the "Powered by" message at the bottom
of lyric fetches

Version 1.1
Date: Monday, August 6th, 2008
> Fixed a minor bug that would've broken the retry
facility if I added another parser.
> Added error handling for missing Ruby libraries
(but kdebase-bin must be installed for them to
display, sorry gnome users)
> Added dependency list to description

Version 1.0
Date: Monday, August 4th, 2008
> Initial release.


More information about the Kde-announce-apps mailing list