My favorites | Sign in
Google
                
Search
for
Updated Feb 13, 2008 by api.kurrik.g00g1e
ActivityStreams  
Examples for using ActivityStreams

Introduction

The following examples demonstrate using the ActivityStream calls in OpenSocial.

These samples use CodeRunner's output call.

You can verify that these samples work on Orkut by running the code and then checking http://sandbox.orkut.com/MyUpdates.aspx

Basic title post

This example posts an entry with a simple title

function postActivity(text) {
  var params = {};
  params[opensocial.Activity.Field.TITLE] = text;
  var activity = opensocial.newActivity(params);
  opensocial.requestCreateActivity(activity, opensocial.CreateActivityPriority.HIGH, callback);
};        

function callback(data) {
  output(data);
};

postActivity("This is a sample activity, created at " + new Date().toString());

Comment by nikhilgupte, Feb 13, 2008

This example gives an "unauthorized" error...

Comment by api.kurrik.g00g1e, Feb 14, 2008

Do you have the application installed and given it permission to post to your activity stream?

Comment by r...@azooba.net, Feb 14, 2008

Can we put links in the activity stream?

Comment by Markitecht, Feb 18, 2008

yes i am curious about links, images etc in the activity stream. a crucial virality feature in Facebook is 'add this app' next to the app's posts in a user's news feed, for example.

Comment by r...@azooba.net, Feb 25, 2008

The example code given on orkut announce and the sample app (http://sandbox.orkut.com/AppInfo.aspx?appId=1014107943644) shows that we can add links/images. However, when i do add the images and links they show up as escaped html in my updates. Will there be a fix coming for it on sandbox?

Comment by kcjagadeep, Aug 02, 2008

paramsopensocial.Activity.Field.BODY? = body; by using <html> tag u can add pictures and links

Comment by rauaugusto, Sep 02, 2008

Can i make more than one activity from my app? When i make a second one it overwrites the first one...

Comment by timotta, Aug 10, 2009

It not works on IE 7


Sign in to add a comment