07.08AS3 - RealNetworks Rhapsody Web Service - Artist Search
Hi Everyone,
A few years ago Real Networks launched some webservices that you can use to find artists, tracks and the like. Although their license is quite limiting, you can view their SDK Documentation here: http://webservices.rhapsody.com/rwssdk/rwssdk_v1_5.pdf the main website being here: http://webservices.rhapsody.com/.
In the last few days I wrote a quick AS3 client for the Artist Search webservice. It is quite useful since it is flexible enough to accept badly spelled artists and give you some good suggestions. Here is the sample usage:
-
package com.real.tests
-
{
-
import com.real.RealClient;
-
import com.real.RealServiceEvent;
-
import com.real.RhapArtistData;
-
import com.real.RhapArtistFeed;
-
import flash.display.MovieClip;
-
-
public class RealClientTest extends MovieClip
-
{
-
protected var _ws:RealClient;
-
-
public function RealClientTest()
-
{
-
_ws = RealClient.getInstance();
-
_ws.addEventListener(RealServiceEvent.REAL_ARTIST_FAILED, doArtistFailed);
-
_ws.addEventListener(RealServiceEvent.REAL_ARTIST_SUCCESS, doArtistSuccess);
-
_ws.searchRhapArtist("Alkalyne Tryo");
-
}
-
-
protected function doArtistSuccess(evt:RealServiceEvent):void
-
{
-
trace("doArtistSuccess");
-
traceFeed(evt.feed);
-
}
-
-
protected function doArtistFailed(evt:RealServiceEvent):void
-
{
-
trace("doArtistFailed");
-
}
-
-
protected function traceFeed(feed:RhapArtistFeed):void
-
{
-
trace("");
-
trace("feed has:" + feed.count + " items");
-
trace("feed startindex:" + feed.startIndex);
-
trace("query total:" + feed.total);
-
-
var artist:RhapArtistData;
-
-
while (artist = feed.next())
-
traceArtist(artist);
-
}
-
-
protected function traceArtist(artist:RhapArtistData):void
-
{
-
trace("");
-
trace("[artist].artistId: " + artist.artistId);
-
trace("[artist].displayName: " + artist.displayName);
-
trace("[artist].availability: " + artist.availability);
-
trace("[artist].primaryGenre: " + artist.primaryGenre);
-
trace("[artist].primaryGenreId: " + artist.primaryGenreId);
-
trace("[artist].contentId: " + artist.contentId);
-
trace("[artist].htmlRef: " + artist.htmlRef);
-
trace("[artist].shortcut: " + artist.shortcut);
-
}
-
}
-
}
You can find the source here. BTW: This service is notoriously slow! Sometimes failes, giving timeouts.
I might expand this in the near future, if I do, I will post updates here!
Cheers!

[...] - bookmarked by 6 members originally found by tea14 on 2008-12-28 AS3 - RealNetworks Rhapsody Web Service - Artist Search http://blog.martinlegris.com/?p=98 - bookmarked by 4 members originally found by ritchie8piper on [...]
January 20th, 2009 at 6:45 pm