Skip to content

Instantly share code, notes, and snippets.

@sbob-sfdc
Created September 5, 2012 20:35
Show Gist options
  • Save sbob-sfdc/3644304 to your computer and use it in GitHub Desktop.
Save sbob-sfdc/3644304 to your computer and use it in GitHub Desktop.
Workshop 303, Tutorial 3, Step 4.1
// add select Chatter functions to forcetk
// get feed-items
forcetk.Client.prototype.chatterFeed = function(id, callback, error) {
this.ajax('/' + this.apiVersion + '/chatter/feeds/record/' + id + '/feed-items', callback, error);
}
// post feed item
forcetk.Client.prototype.postChatterItem = function(id, text, callback, error) {
this.ajax('/' + this.apiVersion + '/chatter/feeds/record/' + id + '/feed-items', callback, error, "POST", '{ "body" : { "messageSegments" : [ { "type": "Text", "text" : "' + text + '" } ] } }');
}
// post feed comment
forcetk.Client.prototype.postChatterComment = function(id, text, callback, error) {
this.ajax('/' + this.apiVersion + '/chatter/feed-items/' + id + '/comments', callback, error, "POST", '{ "body" : { "messageSegments" : [ { "type": "Text", "text" : "' + text + '" } ] } }');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment