|
ActivityStreams
Examples for using ActivityStreams
IntroductionThe 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 postThis 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());
|
Sign in to add a comment
This example gives an "unauthorized" error...
Do you have the application installed and given it permission to post to your activity stream?
Can we put links in the activity stream?
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.
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?
paramsopensocial.Activity.Field.BODY? = body; by using <html> tag u can add pictures and links
Can i make more than one activity from my app? When i make a second one it overwrites the first one...
It not works on IE 7