Skip to content

Instantly share code, notes, and snippets.

@wfarr
Created February 11, 2009 23:28
Show Gist options
  • Select an option

  • Save wfarr/62364 to your computer and use it in GitHub Desktop.

Select an option

Save wfarr/62364 to your computer and use it in GitHub Desktop.
RedditAPI.prototype._vote = function(linkID, isLiked, action) {
logger.log("reddit", "Making vote API call");
var dir;
if (isLiked == true) {
dir = 1;
} else if (isLiked == false) {
dir = -1;
} else {
dir = 0;
}
var params = {
id: linkID,
dir: dir
};
params = this.auth.authModHash(params);
var act = http.PostAction(APIURL(this.auth.siteURL, "vote"), params);
act.chainTo(action);
act.perform();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment