Skip to content

Instantly share code, notes, and snippets.

@rmanalan
Created September 30, 2010 16:40
Show Gist options
  • Save rmanalan/604891 to your computer and use it in GitHub Desktop.
Save rmanalan/604891 to your computer and use it in GitHub Desktop.
Prototype WebCenter Chainable JSON API
var wc = {};
$.getJSON('http://wc/rest/api/resourceIndex',function(d){
wc = JSON.parse(d);
});
// based on @ded's async method chaining http://www.dustindiaz.com/async-method-queues/
// will initiate an async req to get the current user and lazily populates the currentUser
// object.
> wc.currentUser
[object currentUser]
> wc.currentUser.spaces
[object spaces]
> wc.activityStream.getActivities({[obj options]})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment