Here's an update on the stuff I'm currently hacking on. I figured it'd be nice to document the progress we're making with amaroK 1.4, which is approaching a first beta release ("Technology Preview") quickly.
In amaroK we have had automatic lyrics fetching support for quite a while. So far we had this lyrics feature hardcoded in C++, as part of the application. Our code would access lyric.com.ar, fetch the html code and transform it to make it suitable for the lyrics tab. While this worked fairly well for a while, two problems with this approach eventually surfaced:
1) It was not possible to select another lyrics site than the one we had chosen. While Lyrc is a good lyrics provider overall, many of our users wished to see their personal favorite lyrics website supported.
2) As most lyrics site (including Lyrc) do not offer a XML based interface, we had to use a screen-scraping technique. This means, amaroK parsed the html code of the site, extracting the desired information from the html code. This has the disadvantage that a simple change in the website's layout may break the parser. And that's what happened: Shortly after the release of 1.3.7, Lyrc changed their html code a bit, and amaroK wasn't abled to fetch lyrics any longer. This had to be fixed in the subsequent 1.3.8 release.
Sooooo, what to do? Scripts to the rescue! What I did is, ripped the hardcoded Lyrc code out. Ported the C++ code to Ruby. Then added a couple of DCOP calls and script notifications for the communication Script <--> amaroK. Added a slice of XML, and you get your spicy new Scriptable Lyrics Feature, mmh.
What's this techno mumbo jumbo mean for the user?
You will be able to:
- Write/download lyrics scripts for practically any lyrics site
- Upgrade the script in case something breaks
- And it means amaroK now depends on Ruby.
I like it.