Tuesday, August 24, 2010 8:38 AM
Tanzim Saqib
Incarnate Social Avatars
Every day we come across millions of blogs and social networking websites. Whenever we’d like to make a conversation, we comment or reply to the thread. If we do that as an anonymous user, we probably have to be happy with the default avatars like the one you can see on the screen right now. I am sure not all of us are the biggest fans of these avatars. Even if we register, our avatars might be one of these, until we upload one. We visit so many social networking websites that uploading your own avatar again and again is sometimes very annoying.
If you are a web developer or blogger, and would love to drastically change the situation, and improve user experience of your visitors, this post is just for you. I am going to talk about a neat service called Incarnate that can help your visitors reuse the avatars they might have used in some other popular social networking websites.
Incarnate is a free service that can find social avatars for your users from MySpace, Facebook, Xbox Live, Twitter, YouTube, and Gravatar. It’s an open source project from MIX Online Labs. It includes fairly easy JavaScript sample to integrate in your website. It also has Wordpress and BlogEngine.NET plugins. We are using Incarnate in our CodeTV website. To give you an example, a user can type his social networking handle and click Find to get a list of avatars he has used in other websites, and choose one of them.
Incarnate is a WCF REST Service and hosted on Windows Azure. It supports JSON-P. That makes it possible to make cross-domain invocation of the service. It also uses ASP.NET Cache. So, every time it is invoked there’s no guaranty that the result is up-to-date. It has three endpoints as of now, which you can use to get avatar URL for a given provider and username, Gravatar URL for an email address and to get a list of providers Incarnate currently supports:
To make it a little bit easier for you to use from .NET code, we have built a very tiny wrapper for Incarnate. We have four methods you can use. All of them are synchronous, but if you want you can write asynchronous version of them as well, because it’s open source. It also includes a Test class powered by xUnit, which you can use to verify whether Incarnate is functioning as expected. It is particularly useful when you’re in doubt with your code whether the bug lies on your code or theirs.
Wrapper methods:
- string[] GetProviders()
- string[] Incarnate(string username)
- string Incarnate(string provider, string username)
- string IncarnateEmail(string email)
Incarnate Wrapper: http://code.msdn.microsoft.com/CodeTVIncarnate
The complete episode is on CodeTV: http://CodeTV.net/34/incarnate-social-avatars/
Filed under: Web 2.0, CodeTV, Incarnate