stevezhu / meteor-fbgraph Goto Github PK
View Code? Open in Web Editor NEWHome Page: http://criso.github.io/fbgraph/
License: MIT License
Home Page: http://criso.github.io/fbgraph/
License: MIT License
I would rather use your package instead of https://atmospherejs.com/dcsan/facebook-sdk just because it has been updated more recently, but the absence of insctructions just makes this package useless. Yeah, I can read the node instructions, but what applies to meteor and what doesn't? Am i supposed to go read you source or what?
Hi I wonder if you can provide a quick install howto for this package?
after installing it using:
meteor add stevezhu:fbgraph
I've tried to use it with this code (server side):
FBGraph = Npm.require('fbgraph');
which results in:
'Error: Cannot find module 'fbgraph''
I'm trying to follow this tutorial: http://www.andrehonsberg.com/article/facebook-graph-api-meteor-js
Instead of using the old fbgraph npm module, I installed via meteor add stevezhu:fbgraph
. However, I'm not able to get the user data from Facebook. Here's what I have in server/facebook.js
:
function Facebook(accessToken) {
FBGraph.setAccessToken(accessToken);
FBGraph.setOptions({
headers: {connection: 'keep-alive'},
pool: {maxSockets: Infinity},
timeout: 3000
});
}
Facebook.prototype.query = function(query, method) {
var self = this,
method = (method==='post') ? 'post' : 'get',
data = Meteor.sync(function(done) {
self.fb[method](query, function(err, res) {
done(null, res);
});
});
return data.result;
}
Facebook.prototype.getUserData = function() {
return this.query('me');
}
Meteor.methods({
getUserData: function() {
var fb = new Facebook(Meteor.user().services.facebook.accessToken);
return fb.getUserData();
}
});
Here's what I have in client/views/home/home.js
:
Template.home.events({
'click #btn-user-data': function(e) {
Meteor.call('getUserData', function(err, data) {
$('#result').text(JSON.stringify(data, null, 2));
});
}
});
Both err
and data
are returning undefined
in the client. Any ideas where I'm going wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.