iTunes Lyrics Finder + Invalid File Remover

If you use iTunes, this handly little program will find lyrics from http://lyric.wikia.org for your songs. On the iPhone, you can tap the background and read the lyrics while playing songs in the iPod app.

derreckdean.com-iTunesLyricsFinder.zip (189kb)

This is an update from my older post, but since the Lyrics Wiki removed the lyrics API, this program hasn’t worked in some time. However, I now just scrape whats on the web page at the lyrics wiki. Therefore, you should know that the process is a little slow, so be patient.

Also, this won’t modify any songs with existing lyrics. If the lyrics don’t exist for that song, then ILF will download them.


A suggestion for the iPhone UI

When a text message comes through and you are on a call, you have to clear the text message dialog before I can hit End Call. What if I wanted to reply to that text message right then? Depending on the last active state of the phone, I would have to exit out of whatever program was running before, or turn the phone back on, navigate to text messages and reply. What if the dialog that pops up for text messages also contained a button that ended the call and sent you to text messages immediately? In regards to the previously running application state (be it a running program or the phone was “off”/standby), it would discard it – since iPhone apps are supposed to persist their state, any previously running app would resume [realistically, close to] where it left off.

iPhone owners, what do you think?

The iPhone OS is sexy, but I still want to get my hands on a Droid. =]


jQuery Character Counter

First, Laurin Dodd of Computer products for Education mentioned that iPhone’s method of password masking (which masks ever character except the last one typed, and that’s only displayed for 2 seconds after the key is let up) was the most efficient.

Now, I wanted an easy way to be able to throw a character counter on a website. In fact, as many character counters as I need. Instead of write a jQuery plugin, I think it is easier to ID your fields and then specify a SPAN tag with the ID -chars; e.g. textarea #comments would have a span#comments-chars. The default value you put in the HTML is what the enforced maximum length of that control will be. It just seems more intuitive to have a <span id=”comments-chars”>200</span> and doing the appropriate checks, than doing $(“#comments”).charCounter(“#comments-chars”, 200).

Paste the function below into your JavaScript file, then call it to activate your character counters:

// Finds any elements where the ID ends in -chars, and then finds
// its corresponding element (same ID without the -chars), and sets it up
// to where the maximum length of the box is what HTML is in the -chars.
// by Derreck Dean www.derreckdean.com 2009 06 29
function setupCharCounters() {

$("[id$=-chars]").each(function() {
var charCounter = $(this);
var maximumChars = parseInt($(this).html());
var target = $("#" + $(this).attr("id").replace("-chars", ""));
target.attr("maxchars", maximumChars); // save this
target.keyup(function() {
var maxChars = $(this).attr("maxchars");
var value = $(this).attr("value");
var remain = maxChars - value.length;
if (remain < 0) {
remain = 0;
$(this).attr("value", value.substring(0, maxChars));
$("#" + $(this).attr("id") + "-chars").html(remain.toString());



A plea to all users of Windows…

I will start with the plea: Please use something other than Internet Explorer! If you’re really attached to IE, then please upgrade to the latest version.
As web developers and web designers, old Internet Explorer bugs haunt us, requiring to write hacks and design things so that IE doesn’t break the layout. I’m not here to bother you with intricate details, but even upgrading to the latest version of IE (version 8 as of this writing) would help, if you really love that browser. To see IE7 and below no longer used by the mainstream market would be amazing… and we focus on giving you the best user experience.


CPE Order Form is done!

There may be a kink or two to work out, but the order form looks fantastic on Computer Products for Education. It’s taken a lot of R&D to get it as efficient as possible, but it was worth it for the raise in conversion we should get from it.

I’m curious to see how the site could be improved on; chime in and leave a comment. When you do, I’m curious of your age range (13-18, 19-25, 26-45, 45+) and your profession or student status. Was the text easy to read? Were there problems viewing certain sections of pages because of color combinations? Let me know what you think. Thanks!


Lyrics on the iPhone and late-night coding sessions

The iPhone is pretty bad ass.  It will display lyrics from mp3 files if they’re stored in the MP3.  Come to find out if you have lyrics downloaded for your songs, they will show up on your iPhone, iPod Touch, or any iPod running the latest firmware.  This works great for the damn deaf like myself – I swear sometimes my ears have aged to 80 years old while the rest of me stays late 20’s.  Now instead of humming certain pieces from the songs I can actually view the lyrics for the songs that I sing offkey, embarrassing all family and friends within earshot.  At least I’ll know the words to the damn song!

iTunes handles the lyric thing well but there was no way I was going to hand-input lyrics for my abridged 9000+ tracks.  That’s when a Google search showed me an iTunes COM API that’s exposed for people to work with, and even found some example scripts.  3 total hours and 5 bowls later I completed the iTunes Lyrics Finder.  It’s a simple program that reads all files in your iTunes library that don’t have lyrics associated with them, and attempts to find lyrics for that song using LyricWiki.  It won’t mess with files that contain lyrics already.  There are no fancy options; just a simple, elegant interface and a link to Computer Products for Education, which I ask that you visit and consider making a purchase from in the future if my program worked out well for you.

iTunes Lyrics Finder Application
iTunes Lyrics Finder Application

iTunes Lyrics Finder requires Windows, the .NET Framework 2.0 runtime and iTunes.  It’s recommended you start iTunes and don’t open any other iTunes dialogs (like Get Info) while the software finds lyrics for you.  If you start the program with the optional parameter -killinvalid, it will also remove invalid files from your library.  (If you’re not familiar with the command line, right click the program and create a shortcut.  Right click the shortcut, go to Properties, and add a space and “-killinvalid” without quotes to the end of the contents of the “target” box and click OK.  Run this shortcut to kill invalid entries in your library.)

derreckdean.com-iTunesLyricsFinder.zip (194kb)

So after I built this program I found some other programs out there that will do the same thing.  There’s a LOT of these programs out there, some you have to pay for and some free.  Here’s the source code; the program really wasn’t that hard to make, and can possibly hang up or crash or eat all the Oreos you [thought] you hid really well.  I tested this with only my iTunes.  If it does crash, email me a copy of the log file in the application folder and I’ll update it relatively quickly.  Disclaimer: I’m not responsible for fucked files, fried hard drives, lost virginities and the like.  I know the UI isn’t super reponsive, maybe someone with more experience writing multithreaded apps could help.

derreckdean.com-Source-iTunesLyricsFinder.zip (1,500kb)

All it does is loop through your library for audio files that don’t have lyrics, and tries to download lyrics for these files using LyricsWiki.  I worked on the meat of it from 1:30am to 3:30am Monday night and the next day made some minor edits to make it work a little smoother.  I apparently suck at writing multithreaded application still but what I have in place seems to work alright.  If you make changes to the program, send the source back to me to add into the program.

It’s time for me to kick back and relax.  Later.