Growl Notifications for Lala
November 15th, 2008 • Code / Geeking Out / Goodies / Music • 2 Comments
Recently, Jeremiah was kind enough to introduce me to Lala, which is a wonderful music browsing/listening/collecting/buying site. That’s a little convoluted, so maybe a “web-based iTunes with some community features” might be the best way to describe it. Easily my favorite feature is that you can listen to entire songs before you buy, not just 30 second snippets. That’s a huge win compared to most competing stores (Rhapsody MP3 lets you listen to full songs as well, but it lacks an easy method of queueing entire albums). Pricing is another advantage; most albums are $7.49 or less, beating iTunes, Amazon MP3, Rhaposdy MP3, and just about everyone else.
Almost as soon as I started using Lala, I realized that it really needed its own Dock icon and separate browser window. Enter the wonders of Fluid. I created a SSB (Site Specific Browser) for Lala with a cassette tape as the icon. (Sure, it might not make perfect sense, what with it being digital music and all, but it’s better than using Lala’s favicon. If you want another option, the speaker icons by Jonas Rask are very nice.)
However, one important piece of functionality was missing. I’m very accustomed to having Growl notifications for music that’s playing, and while Fluid supports dispatching Growl notifications, there weren’t any existing Userscripts to make it happen. Of course, I couldn’t leave well enough alone and spent a couple hours poking around Lala’s JavaScript to see if I could find anywhere to hook in and grab player notifications. Eventually I tracked down the Header.updatePlaybackNowPlaying function, which had exactly what I needed, and I was able to write a Userscript to generate Growl notifications on Lala track changes.
If you want to set up your own SSB for Lala with Growl notifications (note that you will need to have Leopard for this as Fluid is 10.5-only):
- Download Fluid if you don’t already have it.
- Open Fluid and create a new SSB for http://www.lala.com/ (and set the icon if you’re so inclined).
- Launch your Lala SSB.
- Click the Script menu (the icon to the right of the Window menu) and choose Open Userscripts Folder.
- Download the LalaGrowl Userscript, unzip it, and place LalaGrowl.user.js in that folder.
- Back in Lala, click the Script menu and select Reload All Userscripts.
- Click the Script menu one last time and click LalaGrowl to enable it.
- Reload the page to activate the script (it’ll be automatically loaded from now on, but you have to reload the first time so the code can hook in and grab the information it needs to display notifications).
- (This is optional and not related to Growl notifications). I’d highly recommend checking the Closing the last browser window only hides the window option in the application’s General Preferences. This makes it so that you can close the window and music will continue to play, just like in iTunes.
Hopefully someone other than me finds this useful!
As a disclaimer, I should also mention that if Lala changes their JavaScript significantly, the notifications will stop working, since I am depending on undocumented functionality (Lala doesn’t have an offical JavaScript API).
If you want to be my friend on Lala, here’s my profile page.
♫ M83 - Couleurs (Sasha Invol2ver Remix)
