mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-03 12:27:19 -05:00
12 lines
347 B
CoffeeScript
12 lines
347 B
CoffeeScript
|
request = require 'request'
|
||
|
Promise = require 'bluebird'
|
||
|
|
||
|
module.exports.fetchMe = (facebookAccessToken) ->
|
||
|
return new Promise (resolve, reject) ->
|
||
|
url = "https://graph.facebook.com/me?access_token=#{facebookAccessToken}"
|
||
|
request.get url, {json: true}, (err, res) ->
|
||
|
if err
|
||
|
reject(err)
|
||
|
else
|
||
|
resolve(res.body)
|