From dd28d4898040c4cd8572b272b55490866734c2e2 Mon Sep 17 00:00:00 2001 From: "Stuart P. Bentley" Date: Mon, 25 Feb 2013 04:16:45 -0500 Subject: [PATCH 1/2] Silence jshint nags Remove unused "util" require Add semicolons after function assignments/returns --- index.js | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/index.js b/index.js index 80a41ae..2cbde6e 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,6 @@ var b64url = require('b64url'); var crypto = require('crypto'); var qs = require('querystring'); var restler = require('restler'); -var util = require('util'); var Faceplate = function(options) { @@ -28,8 +27,8 @@ var Faceplate = function(options) { req.facebook = new FaceplateSession(self); next(); } - } - } + }; + }; this.parse_signed_request = function(signed_request, cb) { var encoded_data = signed_request.split('.', 2); @@ -82,8 +81,8 @@ var Faceplate = function(options) { request.on('success', function(data) { cb(qs.parse(data)); }); - } -} + }; +}; var FaceplateSession = function(plate, signed_request) { @@ -99,7 +98,7 @@ var FaceplateSession = function(plate, signed_request) { self.get('/' + self.plate.app_id, function(err, app) { cb(app); }); - } + }; this.me = function(cb) { if (self.token) { @@ -109,7 +108,7 @@ var FaceplateSession = function(plate, signed_request) { } else { cb(); } - } + }; this.get = function(path, params, cb) { if (cb === undefined) { @@ -128,7 +127,7 @@ var FaceplateSession = function(plate, signed_request) { } catch (err) { cb(err); } - } + }; this.fql = function(query, cb) { var params = { access_token: self.token, format:'json' }; @@ -155,7 +154,7 @@ var FaceplateSession = function(plate, signed_request) { }; } restler.get('https://api.facebook.com/method/'+method, { query: params }).on('complete', onComplete); - } + }; this.post = function (params, cb) { restler.post( @@ -169,9 +168,9 @@ var FaceplateSession = function(plate, signed_request) { var result = JSON.parse(data); cb(result.data ? result.data : result); }); - } -} + }; +}; module.exports.middleware = function(options) { return new Faceplate(options).middleware(); -} +}; From 3e4e55fa7ca9df973cbdd2794760f8dc20e60e20 Mon Sep 17 00:00:00 2001 From: "Stuart P. Bentley" Date: Mon, 25 Feb 2013 17:49:15 -0500 Subject: [PATCH 2/2] Use /app to get app info instead of / --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 2cbde6e..7f1cbf6 100644 --- a/index.js +++ b/index.js @@ -95,7 +95,7 @@ var FaceplateSession = function(plate, signed_request) { } this.app = function(cb) { - self.get('/' + self.plate.app_id, function(err, app) { + self.get('/app', function(err, app) { cb(app); }); };