MyspaceToolkit

After spending the last 10 days working off and on against the Myspace Developer Platform (MDP), I have released an initial version of a toolkit (class library) that integrates into the platform. It specifically integrates into the REST API's exposed by myspace. Eventually, I seeing the toolkit evolving with the platform and providing much of the same functionality that the facebook toolkits have provided. As long as there is a similar method by which myspace will allow developers to host pages on an external site and then setup a callback url everything will run well.

Some of the things that I wanted to get done with this library was the basic framework for posting the variables to the MDP API endpoint. It currently has not exposed a highly abstracted layer which would make calls to this request layer. I will be implementing this so that it is quite easy for any developer to access the data needed.

Some of the challenges that I faced while developing this toolkit resided with the authentication method that myspace is using. They are using the OAuth routine which is fairly new to authentication schemes. The general purpose behind it is that you can authenticate users without needing a username or password. You would need to use another piece of data to authenticate them other then a username or password. Then based on a some variables most importantly consumerKey, consumerSecret, Timestamp and then the method to generate a unique signature, you would be able to verify on the serverside that the request is valid based off of this unique hash using (HMAC-SHA1) and converting the result to a Base64 string.

I utilized an existing .NET class library (http://eran.sandler.co.il/ & http://oauth.googlecode.com/svn/code/csharp/OAuthBase.cs) that followed the spec to what I believe is exact. However, the class didn't seem to produce a valid signature and web address according to responses I was getting from the MDP API. You can read about all of my issues here. Needless to say after a few days and many forum posts and plenty of breakpoints I found all of the issues.

It mostly had to do with the way in which the query strings were being URL encoded as well as how the signature was being encoded. Once that was resolved making calls to the Myspace API was a breeze. Now, I'm looking at cleaning up the toolkit to provide that abstract layer in the form of a class called MyspaceClient. This would allow a developer for instance to make a call like:

MyspaceClient mc = new MyspaceClient(String apiKey, String consumerSecret, ... etc);
Datatable dt = mc.GetFriends();

I'm thinking of making it deserialize JSON if that's what is selected to be sent back, otherwise it would be deserializing and serializng of the XML.

Feel free to comment and send me your questions. Additionally, if you would like to join this project just shoot me your contact information to joe [at] joedeveloper [dot] net

Thanks!
Joseph Farrar

kick it on DotNetKicks.com


12 comments