
I'm a big fan of the Zune (I own four of them, believe it or not) - so as a developer, I'm naturally inclined to think about novel ways to write applications for the device. There are several different approaches I've uncovered so far:
In this blog post, I will focus on the before last bullet point - how to create a API wrapper for the Zune Card Web service. To access the Zune user card service, simply point your browser to the following URL (including your Zune Tag - in my case, stormpixel):
http://zcards.zune.net/zcard/usercardservice.ashx?lcid=1033&src=external&zunetag=stormpixel
You'll notice that the Zune Card (zCard) is based on a custom XML schema. The uri provides a link back to the user card service. The id denotes the Zune user id. The firstName, status message and tile images are self-explanatory. The manifest contains additional information about the user, badges, playlists, contact information and preferences:

I've created a preliminary API wrapper using LINQ to XML to access the information contained in the Zune cards. To access information about a Zune card, you can instantiate a variable of type "ZuneCard", passing into it the zune tag of the user. Once the object has been instantiated, you can then pull in user properties and collections (deserialized for your convenience). The example below is a console application where I'm querying the ID for the user stormpixel:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DisplayZuneCard
{
class Program
{
static void Main(string[] args)
{
ZuneCard zuneCard = new ZuneCard("stormpixel");
Console.WriteLine(zuneCard.id);
Console.ReadLine();
}
}
}
If I run the application, I get the console window shown below. In the next blog post, I'll explain in more detail how I implemented the API.
