Blog
RSS feed

Engineering the Windows Live / MySpace integration and Leveraging Activity Streams

My name is Rob Dolin, I work as an engineer on the Windows Live Social team and I’m honored to have the opportunity to guest blog here at http://dev.live.com/ about one of our latest (and IMHO most exciting) features, our integration with one of the world’s largest social networks, MySpace.

We just announced on the Windows Live Team blog, starting the week of September 14th, you can add a MySpace “Web Activity” to Windows Live so that you can bring your activities on MySpace like posting photos, updating status, sharing music, or blogging into Windows Live. Heck, if you have a MySpace account (and hundreds of millions of people already do) you can try it right now:

http://profile.live.com/WebActivities/add.aspx?AppID=1140860417
(link will open in a new window)

About Web Activities

With today’s latest partner integrations on Windows Live, we’ll have over fifty web activities that Windows Live customers can add into their Windows Live experience. (To learn more about all the Windows Live partners, check out our Windows Live Team blog). Nearly all of the web activities employ a polling model where a customer enters some basic information about their presence on a website and then Windows Live periodically polls an XML feed of the customer’s activity on that site. In the past, this feed has been in RSS 2.0 or Atom and then for each partner, we have a custom XSLT that maps the elements from the customer’s feed to the data attributes in Windows Live’s system. For example, yesterday, I was out to dinner with my partner and I posted the below tweet:

(from: http://twitter.com/robdolin)
clip_image002

Since I have already set up the Windows Live web activity for Twitter, my twitter feed, Windows Live can go and read my twitter feed (http://twitter.com/statuses/user_timeline/4044361.rss):
<item> 
     <title>robdolin: @ Capital Grille ! New fall prix fixe menu was great value; H said she would hijack a truck for the truffle mac &amp; cheese #seattle #food</title>
     <description>robdolin: @ Capital Grille ! New fall prix fixe menu was great value; H said she would hijack a truck for the truffle mac &amp; cheese #seattle #food</description>
     <pubDate>Thu, 10 Sep 2009 03:31:14 +0000</pubDate>
     <guid>http://twitter.com/robdolin/statuses/3879866454</guid>
     <link>http://twitter.com/robdolin/statuses/3879866454</link>
</item>

And then publish the update on my behalf to my Windows Live profile:
(from: http://cid-3c8ca60f8f925fec.profile.live.com/)
clip_image004

My friends who use Windows Live then see my update from the Twitter web activity in the following places:

· When they use Windows Live Messenger

· When the login to http://home.live.com/

· When they send me email from Hotmail

· When they visit my Windows Live Profile

Challenges with Web Activities

There are two big challenges with this basic polling model of RSS 2.0 or Atom:

1. We need to develop a custom mapping for each partner

2. Each partner needs to have only one activity type or they need a way to communicate what type of activity each RSS 2.0 <item> or Atom <entry> is.

The emerging Activity Streams open standard comes in to help solve both of these problems.

How Activity Streams Helps

Activity Streams helps to address both of the above issues. First, instead of having to do a custom mapping for practically every Web Activities partner, with an open standard like Activity Streams, we can build a single mapping that can be used by multiple partners.

Second, Activity Streams includes <activity:verb> and <activity:object-type> elements so we can identify that one <entry> is a status update and another is a blog entry. Thus, services that have multiple activity types (like MySpace) can have a single feed that includes photos, status, blogs, music, and more.

MySpace Example

Let me show you an example with MySpace.

On MySpace, I’ve gone and uploaded some photos and written a blog entry. You can see these on my MySpace profile:

(from: http://www.myspace.com/tesstingms)
clip_image006

If I authorize it, MySpace will share an XML feed of my activities that uses the Activity Streams elements:

<entry>
        <id>tag:myspace.com,2009:/activity/473185983/BlogAdd/473185983/509685053</id>
        <title type="text">Tess Ting posted a new blog entry: My Thoughts on the Health Care Debate</title>
        <published>2009-09-11T14:54:33Z</published>
        <updated>2009-09-11T14:54:33Z</updated>
        <author>
            <name>Tess Ting</name>
            <uri>http://www.myspace.com/tesstingms</uri>
        </author>
        <link rel="icon" type="image/gif" href="http://x.myspacecdn.com/modules/common/static/img/blog.gif"/>
        <link rel="alternate" type="text/html" href="http://blogs.myspace.com/index.cfm?fuseaction=blog.ListAll&amp;friendId=473185983"/>
        <category term="BlogAdd" label="BlogAdd" scheme="http://activities.myspace.com/schema/1.0/"/>
        <content type="xhtml">...</content>
        <sx:sync id="tag:myspace.com,2009:/activity/473185983/BlogAdd/473185983/509685053">
            <sx:history sequence="1" when="2009-09-11 14:54:33Z"/>
        </sx:sync>
        <activity:actor>
            <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
            <id>tag:myspace.com,2009:/Person/473185983</id>
            <title>Tess Ting</title>
            <link rel="alternate" type="text/html" href="http://www.myspace.com/tesstingms"/>
            <link rel="avatar" type="image/jpeg" href="http://c2.ac-images.myspacecdn.com/images02/75/s_94cbd2c0ed5e4ef0a4bc02a10aecc011.jpg"/>
        </activity:actor>
        <activity:object>
            <activity:object-type>http://activitystrea.ms/schema/1.0/blog-entry</activity:object-type>
            <id>tag:myspace.com,2009:/Blog_Entry/473185983/509685053</id>
            <title>My Thoughts on the Health Care Debate</title>
            <link rel="alternate" type="text/html" href="http://blogs.myspace.com/index.cfm?fuseaction=blog.view&amp;friendId=473185983&amp;blogId=509685053"/>
        </activity:object>
        <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
    </entry>
    <entry>
        <id>tag:myspace.com,2009:/activity/473185983/PhotoAdd/855905/9132545</id>
        <title type="text">Tess Ting added a new photo to the My Photos album.</title>
        <published>2009-09-11T14:50:50Z</published>
        <updated>2009-09-11T14:50:50Z</updated>
        <author>
            <name>Tess Ting</name>
            <uri>http://www.myspace.com/tesstingms</uri>
        </author>
        <link rel="icon" type="image/gif" href="http://x.myspacecdn.com/modules/common/static/img/photo.gif"/>
        <link rel="alternate" type="text/html" href="http://viewmorepics.myspace.com/index.cfm?fuseaction=viewImage&amp;friendID=473185983&amp;albumID=855905&amp;imageID=9132545"/>
        <category term="PhotoAdd" label="PhotoAdd" scheme="http://activities.myspace.com/schema/1.0/"/>
        <content type="xhtml">...</content>
        <sx:sync id="tag:myspace.com,2009:/activity/473185983/PhotoAdd/855905/9132545">
            <sx:history sequence="1" when="2009-09-11 14:50:50Z"/>
        </sx:sync>
        <activity:actor>
            <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
            <id>tag:myspace.com,2009:/Person/473185983</id>
            <title>Tess Ting</title>
            <link rel="alternate" type="text/html" href="http://www.myspace.com/tesstingms"/>
            <link rel="avatar" type="image/jpeg" href="http://c2.ac-images.myspacecdn.com/images02/75/s_94cbd2c0ed5e4ef0a4bc02a10aecc011.jpg"/>
        </activity:actor>
        <activity:target>
            <activity:object-type>http://activitystrea.ms/schema/1.0/photo-album</activity:object-type>
            <id>tag:myspace.com,2009:/Photo_Album/855905</id>
            <title>My Photos</title>
            <link rel="alternate" type="text/html" href="http://viewmorepics.myspace.com/index.cfm?fuseaction=user.viewPicture&amp;friendID=473185983&amp;albumId=855905"/>
        </activity:target>
        <activity:object>
            <activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
            <id>tag:myspace.com,2009:/Photo/855905/9132545</id>
            <title>
            </title>
            <link rel="alternate" type="text/html" href="http://viewmorepics.myspace.com/index.cfm?fuseaction=viewImage&amp;friendID=473185983&amp;albumID=855905&amp;imageID=9132545"/>
            <link rel="preview" type="image/jpeg" href="http://c3.ac-images.myspacecdn.com/images02/14/s_cb0b48037818485bb99d521a4051ed2a.jpg"/>
        </activity:object>
        <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
    </entry>
    <entry>
        <id>tag:myspace.com,2009:/activity/473185983/PhotoAdd/855905/9132542</id>
        <title type="text">Tess Ting added a new photo to the My Photos album.</title>
        <published>2009-09-11T14:50:47Z</published>
        <updated>2009-09-11T14:50:47Z</updated>
        <author>
            <name>Tess Ting</name>
            <uri>http://www.myspace.com/tesstingms</uri>
        </author>
        <link rel="icon" type="image/gif" href="http://x.myspacecdn.com/modules/common/static/img/photo.gif"/>
        <link rel="alternate" type="text/html" href="http://viewmorepics.myspace.com/index.cfm?fuseaction=viewImage&amp;friendID=473185983&amp;albumID=855905&amp;imageID=9132542"/>
        <category term="PhotoAdd" label="PhotoAdd" scheme="http://activities.myspace.com/schema/1.0/"/>
        <content type="xhtml">...</content>
        <sx:sync id="tag:myspace.com,2009:/activity/473185983/PhotoAdd/855905/9132542">
            <sx:history sequence="1" when="2009-09-11 14:50:47Z"/>
        </sx:sync>
        <activity:actor>
            <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
            <id>tag:myspace.com,2009:/Person/473185983</id>
            <title>Tess Ting</title>
            <link rel="alternate" type="text/html" href="http://www.myspace.com/tesstingms"/>
            <link rel="avatar" type="image/jpeg" href="http://c2.ac-images.myspacecdn.com/images02/75/s_94cbd2c0ed5e4ef0a4bc02a10aecc011.jpg"/>
        </activity:actor>
        <activity:target>
            <activity:object-type>http://activitystrea.ms/schema/1.0/photo-album</activity:object-type>
            <id>tag:myspace.com,2009:/Photo_Album/855905</id>
            <title>My Photos</title>
            <link rel="alternate" type="text/html" href="http://viewmorepics.myspace.com/index.cfm?fuseaction=user.viewPicture&amp;friendID=473185983&amp;albumId=855905"/>
        </activity:target>
        <activity:object>
            <activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
            <id>tag:myspace.com,2009:/Photo/855905/9132542</id>
            <title>
            </title>
            <link rel="alternate" type="text/html" href="http://viewmorepics.myspace.com/index.cfm?fuseaction=viewImage&amp;friendID=473185983&amp;albumID=855905&amp;imageID=9132542"/>
            <link rel="preview" type="image/jpeg" href="http://c3.ac-images.myspacecdn.com/images02/22/s_e15bb4f34a324a9fbc4c23d518230ff6.jpg"/>
        </activity:object>
        <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
    </entry>

(The above example XML is of a blog entry and two photos. MySpace supports a ton more activity types and they have great documentation on this on their developer wiki: http://wiki.developer.myspace.com/index.php?title=Standards_for_Activity_Streams. The Windows Live web activity integration includes these MySpace activities: posting a blog entries, posting forum topics, updating status, posting photos, getting tagged in a photo, posting a song, adding a profile song, adding a profile video, and RSVP’ing yes to an event.)

Now, if I’ve connected the MySpace Web Activity in Windows Live: http://profile.live.com/WebActivities/add.aspx?AppID=1140860417, Windows Live will periodically poll my Activity Stream XML feed from MySpace and when there are new entries, Windows Live will publish these new MySpace activities to my Windows Live Profile:

(from: http://cid-e16138db6f261cbd.profile.live.com/)
clip_image008

Reading More

If you’re interested in learning more about Activity Streams, you should feel free to visit the working group’s website: http://www.ActivityStrea.ms/ and the group’s wiki: http://wiki.ActivityStrea.ms/.

If you’re interested in developing more with Windows Live, I’d encourage you to start at http://dev.live.com/ and http://msdn.microsoft.com/.

Thanks very much for reading all of the way through ;) and I’m looking forward to working with more of you to enable our mutual users to share their activities with their friends across the web. All the best—

--Rob Dolin
Engineer, Windows Live team
http://robdolin.spaces.live.com/

P.S. I want to extend a personal thank you to Monica Keller and the folks on the MySpace Engineering team who were great to work with.

Published Monday, September 14, 2009 11:22 by lsteam