Overview and getting started
From iLike
Contents |
High-level architecture overview
The iLike Developer Platform is built in such a fashion so that you can add music to Web pages (or Facebook FBML applications) using a few lines of script (JavaScript, or FBJS). Individual script function calls can display a song, prompt the user to select a song, or display a playlist. You don't need to worry about how to implement music-search across the catalog, or worry about music playback, etc. We take care of those things.
You can reference songs by artist-name + song-name, or by track id. How do you get a track id? By using the iLike song-chooser, which displays a search interface for your users to pick a song. When dealing with playlists, you don't even need to worry about storing the songs (or their order) within the playlist. Because we know that most features involving a list of songs require the same activities, we let you simply pick a unique playlist ID, and we'll keep track of edits made by your users and save the data on the back-end.
The first step - getting your Developer Key
First, if you haven't done this already, you need to sign up for an account as an iLike Developer, and get your "developer key". Please make sure to sign up with a valid email address (we won't spam you, but we may send you important Platform updates).
Your developer key will be used in all your calls to the iLike Developer Platform, and will enable us to track your usage of the platform.
Also, to contact our team and ask questions, join our developer mailing list
At the top of each page...
The following line of code needs to be included at the top of any page on any page that will use the iLike Developer Platform. (If you don't want to put it at the top of the page, it certainly needs to appear before any of the other platform API calls)
HTML:
<script src="http://www.ilike.com/api/js"></script>
On Facebook (FBML):
<fb:ref url="http://fb.ilike.com/api/fbml_js" />
Each call to the iLike platform API requires your developer key. You can either pass a parameter named devKey to every API call, or you can set a global variable named _iLikeDevKey. The global variable is convenient if you are making several API calls per page since you don't need to pass the key to each method. Visit the iLike Developer Dashboard to request a key.
For example:
<script> _iLikeDevKey = "dbe5e0423c79476d8374292e0d7f1ee9"; </script>
The main components of the iLike Developer Platform
To fully understand the platform, read the documentation for the iLikeSongChooser, iLikeDisplaySong, and iLikeDisplayPlaylist. All three are available not only in HTML/JavaScript, but also in Facebook's FBML/FBJS.
iLikeDisplaySong
If you want to build a service or feature that deals with single songs that are editorially chosen by you, you can use iLikeDisplaySong to show and play music based on your editorial selection.
iLikeSongChooser
To enable users of your Web site (or Facebook app) to select individual songs, use iLikeSongChooser - this command displays a search-box that allows a user of your Website to select a song, giving you back a "track id" that you can then pass to iLikeDisplaySong to display the song that was chosen. If you want to add a single song to a gift, a poke, a profile, a message, a taunt, a wall, a greeting message, etc, this is the easiest way to do it.
iLikeDisplayPlaylist
To add multiple songs or playlists to your site, use iLikeDisplayPlaylist. A playlist can be displayed in view-only mode, or in edit-mode, or in "add" mode. As the developer, you can select what mode to show a playlist in. Your code simply tells us to display a playlist, and in what mode. When it's in an editable mode, your site visitors can modify the playlist, and we save the changes on the backend, and you get a cool feature without dealing with any of the user-interface or backend storage.
For example, for a user who wants to decorate their page, you can display a playlist in edit-mode when viewed that the user, and in view-only mode when the page is seen by any other visitor. Or, if you want to allow users to add playlists to a group page (such as a party invitation), you can display it in "add" mode when viewed by group participants (thus anybody can add their music to the party playlist), but limit it so only the group/event administrator gets to see the playlist in "edit" mode to re-order or remove songs. Under the covers, the iLike Developer Platform handles storing the list of songs within the playlist, so you only need to worry about telling iLike what mode to display it in.
That's it!
Believe it or not, that's all there is to it. We have lots of ideas for additional capabilities we want to add to this system, but we actually believe that the simplicity of it is what makes it so special. There's very little to learn, but these three ingredients can enable a lot of rich and unique services. Of course, we're not stopping here - there is a lot more we want to do with this. If you're interested, check out our Thoughts for the next version.
