WinCoder Blog

Create A Music Playlist Generator with Yahoo Pipes and Yahoo WebPlayer



Introduction

With the popularity of services like Spotify and Pandora, it is clear that playlist generation is something many of us enjoy.   The highly popular /r/music is regularly introduced to services which generate playlists from aggregated content.  These include sites like fuhshnizzletubalr, and my very own searchler.  This post is going describe how to create your own music video playlist generator with little to no coding. The benefit is that you can use your own creativity to make any type of generator you prefer.

I want this post to be inclusive to anyone, so I want to remove any need for web hosting service or development environment.  To accomplish this, we will leverage the Yahoo Pipes Service.  Yahoo Pipes lets us aggregate data from pretty much anywhere and manipulate it in a variety of ways.  We will discuss it in more detail in the tutorial portion of this post.

What comprises a playlist generator service?

Let’s begin with what a playlist generator service encompasses.  In the most simple terms we need to have a list of what we want to play, a place to get the content from, and a way to play that content.

From a technical standpoint, we will follow the following recipe:

1. Get some text data that represents what you are looking for (Info we need to construct playlist)
2. Ask some content provider for results based on that data  (API that returns actual audio/videos sources)
3. Present the results received from the content provider in some way (A website or application)

How will we satisfy the requirements for the playlist generator recipe?

Let’s think abstractly about this for a second and think about how we can apply this recipe in a variety of ways.

We could satisfy #1 by getting a list of:

We could satisfy #2 by taking each item in #1 and getting:

We could satisfy #3 by taking the content found in step #2 and consuming it in:

  • Yahoo Pipes – Using the automatically integrated Yahoo Web Player (no coding necessary)  Example below
  • A website – Using JWPlayer you can consume Media RSS feeds (the output of the example pipes) Example:(View Source @ Searchler.com)
  • A mobile/desktop/tablet application – This is outside the scope of this article, but provided a service, you should be able to present on a variety of platforms.  Mobile Example / Tablet Example

Creating the Playlist Generation Service with Yahoo Pipes

Okay, I keep talking about Yahoo Pipes.  What is the big deal?  It is a free service (as in free beer), it’s fun (try it, trust me), and anyone can use it (code is created by dragging and dropping elements in a UI).  From a technical standpoint, Yahoo Pipes is geo-distributed, highly available, and allows you to create RSS, JSON, and custom feeds extremely fast.  Also, Yahoo recently created this cool thing called the Yahoo Web Player that embeds a player on pages with music/video links and it integrates with Yahoo Pipes by default, meaning we can use and enjoy our playlist generator service right away!

Let’s get started.

1. Head over to Yahoo Pipes and start an account – http://pipes.yahoo.com

2. Create a new pipe

3. Go to my published pipes – http://pipes.yahoo.com/wincoder, there should be multiple example pipes

4. Let’s highlight “Artists / Songs from Last.FM to Videos copy” and click “Clone”

5. You should see the following, you are now working with your own copy of this Yahoo Pipe

6. Click Edit Source to see how the pipe works

Notice how the pipe works.  It takes an input, gets a result from Last.FM, then for each item in those results, it asks Youtube for a video and outputs the result in Media RSS format (removing duplicates and empty video links).

7. Listen to the playlist – Click the play icon next to any of the results and the Yahoo Web Player will create a playlist control in the bottom left hand corner of the screen with a playlist contain all of the results from the Yahoo Pipe

Note about using pipes in applications

Some of you may be curious if Yahoo Pipes output can be used for mobile services.  The answer is yes, but your service will be at the mercy of Yahoo’s support for Pipes and API limits.  Yahoo Pipes nonetheless provides a great playground for prototype development.  You may also consider Pipe2Py to potentially convert you Yahoo Pipes into Python.


Summary

After following the above tutorial, be sure to check out the other Pipes supplied @ http://pipes.yahoo.com/wincoder

At time of writing, in addition to the pipe used in the example, the above link also contains a pipe which uses Last.Fm to create a playlist of similar artists and one that constructs a playlist of tracks from a supplied artist and album using Musicbrainz.

If you keep in mind the three steps of the playlist generation recipe, you can create many interesting off shoots given the examples provided.  Simply clone the provided pipes and modify at will.

Feel free to ask any questions in the comments and let us know if you make a cool playlist generator of your own!

Happy hacking,

Paul

>


Leave a Reply

Your email address will not be published.