OpenSocial Activity Publishing Integration

Page history last edited by Chris Messina 9 mos ago

This page documents some ideas for how to extend OpenSocial to allow OpenSocial applications to raise activities that containers can then publish in Atom feeds with activity extensions.

Background

Currently MySpace is publishing activity feeds of their activity streams including activity extensions. However, currently there is no way to publish meaningful activity semantics for arbitrary activities raised by applications using their OpenSocial API since OpenSocial offers no way for applications to specify the activity annotations for events they raise.

The goal here is to extend OpenSocial with a mechanism to allow applications the flexibility to publish arbitary Atom and activity streams markup along with the human-readable information they already publish without excessive extra work.

Facebook's proprietary news feed API has similar issues. While this work will not directly address this, it is hoped that the high-level approach adopted here will map sensibly onto Facebook.

High-level Overview

The current best thoughts here are to:

  • Augment the OpenSocial "Activity" type with an additional argument to select a template for turning the activity into one or more Atom entries.
  • Specify a variation on the OpenSocial template bundle format for the transformation.
  • Add an extension to the application manifest to allow an application to optionally nominate such a bundle.

Here's a big load of stuff I need to actually write about

{
    "appId": "blah blah",
    "bodyId": "5",
    "id": "example.com:5348975623894",
    "mediaItems": [
        {
            "id" : "11223344",
            "thumbnailUrl" : "http://pages.example.org/images/11223344-tn.png",
            "mimeType" : "image/png",
            "type" : "image",
            "url" : "http://pages.example.org/images/11223344.png",
            "album_id" : "44332211",
            "title": "My Cat",
            "description": "My cat on a mat with a rat",
        }        
    ],
    "templateParams": {
    },
    "postedTime": "2009-12-12T12:34:12Z",
    "priority": 1,
    "titleId": "4",
    "url": "http://blah.myspace.com/something/blah",
    "userId": "5",
    "activityStreamsMessageId": "10",
}

{
    "id": "example.com:5348975623894",
    "atomId": "tag:example.com,2009:5348975623894",
    "body": "Martin posted this photo!",
    "mediaItems": [
        {
            "id" : "11223344",
            "atomId": "tag:example.com,2009:photo-11223344",
            "thumbnailUrl" : "http://pages.example.org/images/11223344-tn.png",
            "mimeType" : "image/png",
            "type" : "image",
            "url" : "http://pages.example.org/images/11223344.png",
            "album_id" : "44332211",
            "title": "My Cat",
            "description": "My cat on a mat with a rat",
        }        
    ],
    "templateParams": {
    },
    "postedTime": "2009-12-12T12:34:12Z",
    "priority": 1,
    "title": "Martin posted a photo titled \"My Cat\"",
    "url": "http://blah.myspace.com/something/blah",
    "user": {
        "nickname": "Martin",
    },
}

<a:entry xmlns:a="http://www.w3.org/2005/Atom" xmlns:as="http://activitystrea.ms/spec/1.0">
    <a:id>${atomId}</a:id>
    <a:title>${title}</a:title>

    <a:content type="xml">${body}</a:content>

    <as:verb>http://activitystrea.ms/schema/1.0/post</as:verb>
    
    <a:published>${postedTime}</a:published>

    <a:link rel="alternate" href="${url}" type="text/html" />

    <as:object>
        <a:id>${mediaItems[0].atomId}</a:id>
        <a:title>${mediaItems[0].title}</a:title>
        <a:link rel="preview" type="${mediaItems[0].mime_type}" href="${mediaItems[0].thumbnailUrl}" />
        <a:link rel="enclosure" type="${mediaItems[0].mime_type}" href="${mediaItems[0].url}" />
        <as:object-type>http://activitystrea.ms/schema/1.0/photo</as:object-type>
    </as:object>

</a:entry>

Comments (0)

You don't have permission to comment on this page.