Chicago Hacks

  • Archive
  • RSS

Rdio.com bookmarklet powered by Kyntex and YQL

UPDATE: I won the contest! Now I don’t have to wait in line to get my new iPad2.

With 5 minutes to spare, I just submitted my entry to the Kynetx + Mashery contest.

It’s a bookmarklet that allows you to select some text on a page (e.g. an album title), and then it’ll go off and snag the top search result from Rdio, which gets displayed in a little notification window with two links for listening and full details.

Before I get into all the fine print and boring technical stuff, give it a shot. Just drag the following link to your bookmarks bar, select an album title somewhere on the internets, and click the bookmark:

Find it on Rdio

Please drop me a note with your feedback.

I didn’t find out about the contest until a few days ago. By happy chance, Rdio had just released their API via the fine folks at Mashery. I love how quick it is to sign up for new APIs once you have a Mashery account.

So here’s what’s going on behind the scenes:

- If the bookmarklet is clicked and there’s no text selected, you get a simple Javascript alert. If there is text selected,

- Kynetx triggers a call to YQL, using an Open Data Table I created for searching Rdio. I can just send my key, secret (both of which are tucked away in the Kynetx app), and search terms to YQL, and it handles all the esoteric oAuth request signing, which Rdio requires even if you’re making a call the doesn’t require authentication. YQL is also doing some nice limiting and trimming of the results (not to mention caching), so things move along as quick as possible.

- If we’ve found no results, a little notification tells you so. If we do have a result, the album art and two links are embedded in a default “notifier” box, which is one of the handy built-in Kynetx UI bits. If you click the “Listen now” link,

- Kynetx makes yet another call, this time directly to the Rdio oEmbed API to get the HTML code we need for the embedded player. The main notification disappears and a slide-on-hover sidetab appears in its place.

My original (and still on the roadmap) plan was to allow albums to be saved to a “Listen Later” playlist. Those kinds of calls require oAuth from the user. After many painful hours I managed to get all oAuth calls working individually, but ran out of time before I could stitch them into one functioning whole.

This was my first time using playing around with Kynetx. The biggest challenge for me was learning what goes where. I kept trying to write jQuery and proper Javascript right within the KRL script. Eventually I caught on to the emit directive, which is how you actually spit Javascript out to the page and do anything that you can’t accomplish with the built-in KRL methods.

    • #kynetx
    • #YQL
  • 1 year ago
  • 32
  • Permalink
  • Share
    Tweet

32 Notes/ Hide

  1. ungroomednec liked this
  2. lemongrasska liked this
  3. bobpedant57 liked this
  4. benisonrooki liked this
  5. inspecthell liked this
  6. ckolderup liked this
  7. moustache liked this
  8. chicagohacks posted this
← Previous • Next →

About

Organized by Jed Wood, part of the Labs team at gravitytank and co-founder of LimeChile.
  • RSS
  • Random
  • Archive
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr