November 5th, 2008 |
Published in
Code, Technology
Earlier this summer I had noticed that National Public Radio (NPR) launched a brand new open API based on open source technologies. My initial reaction was at best skeptical. I assumed any sort of “API” released by a major media outlet would turn out to be nothing more than a few customizable RSS feeds. If the company was particularly progressive the RSS feeds might include full articles, rather than the neutered one-sentence teasers you find in all the big name’s syndicated content.
I couldn’t have been more mistaken. NPR’s API is no small potatoes. Just take a look at the comprehensive Query Generator to get an inkling of the types of complex queries you can create. Looking at the Query Generator also sheds some light on the content you can retrieve using the API. The API’s main page says the API exposes the entire NPR archive of content starting from the launch of the NPR website in 1995. Just how big is this archive? Over 250,000 stories including text, images, video, and audio!
This quote from the article announcing the API caught my eye immediately:
There were quite a few questions that we addressed when developing the API, but one thing that was not really in question was the need to open as much of our content as possible.
This isn’t the first open media API. BBC was the first to offer a public open access API, however BBC’s API is restricted to the content from the past 7-days. Seven days! That’s nothing compared to the (approx.) 4748 days - and counting - that NPR’s API offers. NPR and the BBC are two large companies leading the technological shift towards open and free information.
But that’s only half the story.
After discovering this fantastic API I had to do something with it, and the new service architecture in Amarok 2 provided the perfect platform to build a NPR mashup. That was several months ago, and at the time the scripting API in Amarok was still being flesh out (Thanks to Peter). On Monday I noticed the BBC scriptable service Nikolaj had created for Amarok 2. I happened to have several hours of free time, so I cooked up a similar service for NPR:


You can get it at kde-apps or via the “Get More Scripts” button in Amarok 2’s Script Manager.
There is definitely room for improvement and in fact here are a few things I plan to do with it:
- Display more than 20 stories under a category
- Sort content by date
- Support searching
- Display the full articles, with images, in the context view
Major props and thanks go out to the entire NPR technical team and all the contributors who made API a reality.
September 18th, 2008 |
Published in
Code, Technology
If there was a blogger award for “Most likely to make timely posts”, then in no possible world would I even be considered for the award. I could list some excuses that sound legit in my head, but the real reason I don’t feel motivated to post often (or on time) is because I’d rather spend that time in Google Reader reading everyone else’s exciting content (that was not sarcastic).
So, lets see… last time I posted I was en route to Akademy 2008 (the KDE developers conference). That was July 30th, now, a month and a half later I am back from Europe (which was amazing), GSoC is over (sad), and class has started (jury’s still out).
Current Status of the MP3tunes Amarok Service
The Good (Works)
- Browsing & Streaming
- Querymaker is as functional as possible with the current API
- Manual Downloading from MP3tunes to Local Collection
- Manual Uploading from any Collection to MP3tunes
The Bad (Doesn’t work)
- AutoSync - 80%- The code is there, however there are problems with the daemon not receiving signals from the MP3tunes’ servers
- MP3tunes playlists support - 0%- Never got started on this
The Ugly
There is one large issue I am still wrestling with. The details of the issue are complicated, but essentially it deals with the way Amarok handles remote tracks in playlists across sessions. Generally, remote tracks’ metadata isn’t cached by Amarok for use between multiple sessions. So, if you add an mp3tunes track to a playlist in Amarok, then restart Amarok and try to play that playlist the mp3tunes track is blank. Now, there exists a method for retrieving that metadata, however it was originally implemented synchronously. When you are retrieving metadata for any significant number of tracks (10+) synchronously, and each one of those retreivals is an HTTP Get request you end up blocking the GUI thread. At Akademy I hacked a way to do this asynchronously, but it is a really nasty hack. I’ve got code on my computer that implements this feature correctly, but it has the nasty habit of crashing Amarok every so often.
Between classes, marching band, homework, and other responsibilities I’m working on getting this ironed out and committed. Hopefully this will happen before the 2.0 release, because right now using MP3tunes in Amarok across sessions is slow and annoying.
July 30th, 2008 |
Published in
Life, Technology
The ball has been dropped by me - dropped hard - during the past several weeks. First, I was stumped for a week and a half by the glib+qt fiasco, then my development machine’s hard drive shuffled off the mortal coil. Replacing it took a solid week, and when it finally arrived I installed Gentoo. Two days later, the finally install completes as I’m frantically throwing my life’s possessions into a car:
- clothes
- 2 laptops
- 1 Target desk (retail $50)
- assorted books
- 1 blow-up air mattress
Fast forward through seven hours of me hurtling down the interstate at not-so-safe velocities, and here I am, pardoning my recent idleness as my flight to Paris boards at gate D32. Not accomplishing much over the past several weeks suddenly doesn’t seem so bad: I’m going to Europe! There is a week long hack-a-thon at Akademy; I’ll catch up then.

A bientôt!
July 17th, 2008 |
Published in
Code, Technology
I’ve been slacking on the update reports over the past two weeks, because I’m holding out for the exciting post where I say “MP3tunes AutoSync is working! Huzzah!” Sadly, this report isn’t that one.
For the past week I’ve been banging my head against the wall of glib, QtEventLoop, and QThreads. I have quite a headache to say the least, but yesterday thanks to my mentor and Ian, both Amarok developers, my head actually broke through that wall. Literally. GLIB, and Qt are kowtowing at my feet swearing oaths of fealty. They have promised to work together and let me get back to doing fun things, like code new features.
July 8th, 2008 |
Published in
Code
Some non-Summer-of-Code related business popped up over the weekend, to take care of which required a slight road-trip. As such, I haven’t had much time to work on my project, however I’m heading back home today and I plan to get the code I have chilling in my local branch pushed to the main subversion repository.
Surprisingly, bulleted lists seem to be the most concise means to list progress [/sarcasm]
- Still working on Harmony integration.
- Harmony authentication is working (Thanks Lateralus from MP3tunes!).
- The daemon is receiving notification updates.
- Notification processing is what I’m working on now.
While looking at my last couple reports about harmony, I realized that the information is somewhat dry. I think this is because harmony is a highly technical, behind the scenes feature, and, also, often it is difficult to inject excitement into mundane programming updates. The humdrum is slightly symbolic of harmony. You will enable it once and forget about it as it silently keeps your music collection synced.
Related posts: GSoC Report Week 5: Harmonizing Amarok, One small step for Amarok…