Giter Site home page Giter Site logo

meteor-fbgraph's Introduction

Build Status

A meteor wrapper package for fbgraph

Currently using fbgraph v1.2.0

Usage

Can only be used server side. Consult fbgraph for documentation. The only difference is that the graph referenced in the readme is instead FBGraph in this package. You do not have to require the module yourself.

Example

FBGraph.setAccessToken(access_token);

meteor-fbgraph's People

Contributors

stevezhu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

meteor-fbgraph's Issues

Getting undefined back from FB

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?

Install howto

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''

no readme

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.