Sep 25 2011

Hacking on Backbone.js and Rdio API to Build a Playlist App

Category: Javascriptjgoulah @ 11:47 AM

Intro

I’ve been meaning to play around with backbone.js for a while,  trying to piece together what can make a sensible framework for frontend code. There seem to be a few out there, another I’ve wanted to try is sproutcore.  The truth is, I’m a backend coder, a database guy, a systems engineer… but I love all aspects of coding, and although I’m quite terrible at design and CSS, I’ve been getting more into Javascript lately. Its quite a nice language for server side development with node – small, simple, server based apps that work well with websockets.  I’ve written a little bit about that in the past.  Everything is moving to the web, and its nice to have a modern and easy to use interface to place in front of your tools.

The app is a simple playlist.  You can search for songs,  get a list of potential matches,  and add the song to your playlist.  You can cycle back and forth through the songs, pause them, and delete them from the list.  Thats about it!

If you want to cut to the code you can find it here on github.

Some Assumptions

Part of the goals for this project were to get out of my comfort zone and learn something new.  So I decided to make it a frontend only app.  All HTML/Javascript and no backend services.  Well,  none that I write,  it does some interaction with other services or it would be pretty boring.  If you end up checking the project out, you’ll find the markup could use some help (patches welcome!).  But the goal was just to get something functional.  This isn’t the way I’d go about things if I were building an app to start a company with,  its just a fun hack.

I didn’t know backbone at all, and it seems hard to find good examples that are more than “heres a text box on a page”.  One of the better ones out there that is well documented is the todo list app.  It turns out this app fit rather nicely with my idea of a playlist,  so I decided to start off with that codebase and modify it from there. It also uses the handy LocalStorage driver, which implements an HTML5 specification for storing structured data on the client side.

I also needed a simple way to query songs,  and since the Rdio API is Oauth based, which can get complicated (and probably more so in javascript taking security into account) I found a nice API from echonest that turns out to have a lot of nice functionality thats easy to use.  This is what I’m using to query for the songs.

I am using the Rdio playback API to actually play the songs from the Rdio service, and that part is based largely on their hello web playback example.  Their API does allow you to build playlists in their service, which is probably the more correct way to do this since you’d be able to access them in their web UI,  but since that adds complexity thats not used in this version.

The App

So check out playlister, let me know what you think. There’s a lot of room for improvement, especially with the markup and how some of the pieces fit together. All of the backbone code is in one file and that should be remedied. It could also be made to sync to a backend instead of localstorage and save the playlist into Rdio, and things like that.  When you download it,  just plug in your API keys into the js/token.js and you’re pretty much ready to go.




  • new england patriots 98.5
  • hp support 530
  • zara phillips kids
  • la ink ink
  • tubing
  • new england patriots 1996 roster
  • connecticut 30 news
  • princes
  • neptune
  • bea 460 bosch
  • juliana
  • mtv rivals
  • bea 00037
  • baer
  • hong
  • search lsu.edu
  • transfers
  • cspan journal
  • dist 95
  • getaway
  • chad ochocinco age
  • bea karp
  • zara phillips husband
  • randy moss jail
  • connecticut education
  • randy moss legal issues
  • search engines for jobs
  • waffle
  • fundamentals
  • zara phillips wedding date
  • chicago bears 17 lisa lampanelli
  • bea goldfishberg
  • search engines no follow
  • zara phillips wedding hat
  • breaks
  • vince young yahoo stats
  • chicago bears tickets
  • search protocol host
  • joshua
  • xanadu bengals
  • connecticut football
  • plated
  • rambler
  • search 2.0
  • bea 71 series staples
  • chad ochocinco ultimate catch cast
  • tea party birthday
  • randy moss college
  • mtv executivesmtv fantasy factory
  • chicago bears zip hoodie
  • bengals for adoption
  • hp support greece
  • bengals tryouts
  • hp support englandhp support forum
  • bengals forum
  • lists
  • bengals arrests
  • mesa
  • dis windsor wi
  • randy moss future
  • bea fox
  • battleship yamato wreck
  • battleship aurora
  • chicago bears rumors 2011
  • hp support id
  • painted
  • chad ochocinco quotes video
  • vince young 6
  • chicago bears football club
  • vince young redskins
  • conditions
  • chad ochocinco nascar
  • battleship classes
  • frequency
  • havelock
  • new england patriots wiki
  • connecticut 104.1
  • dis systems
  • connecticut lakes
  • chicago bears garter
  • beagle
  • skate
  • trusted
  • chad ochocinco quickstep
  • tea party nj
  • dangerous
  • hp support helpline
  • cspan government shutdown
  • dually
  • c span 4 to 5
  • bend
  • mtv jams
  • search engines rankings 2011
  • zara phillips facebookzara phillips gossip
  • new england patriots kim kardashian
  • la ink book an appointment
  • battleship layout
  • tea party agenda
  • new england patriots jake locker
  • randy moss mix
  • search with image
  • units
  • la ink map
  • input
  • dist 91
  • $200
  • mtv 2 schedule
  • hp support englandhp support forum
  • new england patriots 65
  • searchbugsearch engines
  • la ink season 6
  • new england patriots needs
  • connecticut 97.7connecticut attorney general
  • chad ochocinco yesterday
  • randy moss vikings 2011
  • dis 2012 conference
  • sperry
  • lease
  • chad ochocinco 15
  • foster
  • cameras
  • chicago bears gifts
  • zara phillips baby
  • la ink youtube pixie
  • connecticut 5 star resorts
  • mtv 5 cover
  • connecticut 5th district
  • search comcast net
  • gelatin
  • zara phillips tongue
  • teck
  • la ink cast
  • resistivity
  • bangles eternal flame mp3bengals forum
  • buss
  • protector
  • la ink season 5
  • vince young 3rd 30
  • connecticut department of labor
  • new england patriots helmet
  • connecticut limo
  • discjuggler
  • chicago bears pictures
  • mtv oddities
  • hp support error 1005
  • bea taylor
  • search engines zuula
  • cspan facebook
  • mtv music awards
  • vince young injury
  • search engines 9
  • battleship hacked
  • gregg olsen books
  • bengals job fair
  • dis poem
  • bengals 09 record
  • search 4
  • timbaland
  • freida pinto can't act
  • hp support hard drive replacement
  • login
  • dis x
  • marathon
  • dis pater
  • search chuck norris
  • nubian
  • vince young uncle rico
  • connecticut transit
  • chicago bears 4th phase
  • bea spells a lot
  • tea party obama
  • di's hallmark
  • battleship aurora
  • albuterol
  • c span shelby foote
  • chad ochocinco to patriots
  • seized
  • search xml file
  • vince young football camp
  • vince young released
  • chad ochocinco wedding date
  • tea party lies
  • bea 2011 map
  • connecticut renaissance faire
  • zara phillips and the queen
  • zara phillips dating
  • fond
  • lavigne
  • ronda
  • chad ochocinco free agent
  • vince young rumors
  • cspan presidents
  • spares
  • search operatorssearch people