criso / fbgraph

NodeJs module to access the facebook graph api
http://criso.github.io/fbgraph/
1.09k stars 176 forks source link

Added params to fql query method #47

Closed rob0rt closed 10 years ago

rob0rt commented 10 years ago

Hello!

First of all, thank you for this library, it's incredibly easy to use and very helpful.

I'm writing an application which requires an access token to be provided per-request for FQL queries, which I noticed your application does not support, since appending it to the query string makes the ampersand get eaten by the encodeURIComponent method. Since the FQL method simply calls the get method, I realized adding this support would not be complicated, so I went ahead and added it in my fork (so I myself could use it). This makes the FQL method signature closer to the get method signature, but I did add in a check to make sure the modifications are backwards compatible. In the event this is useful for you, I have opened this pull request.

Thanks!

thinkloop commented 10 years ago

I was just about to implement something similar before checking here. The code looks good, I hope it gets merged in. +1.

@BobertForever what's a good way to apply this change to my local node project before it's merged?

rob0rt commented 10 years ago

@thinkloop If you are using a package.json file, simply doing something like the following will work:

{
    "name": "your-app",
    "version": "0.0.1",
    "main": "app.js",
    "dependencies": {
        "fbgraph": "BobertForever/fbgraph"
    }
}

If you are installing dependencies manually using npm, running

npm install BobertForever/fbgraph

should do the trick

thinkloop commented 10 years ago

Works like a charm! Thank you sir.

criso commented 10 years ago

Awesome! Please add to the fql section on the docs and I'll merge it after that

rob0rt commented 10 years ago

@criso I've added a new segment to the docs, my pull request has updated with the changes

criso commented 10 years ago

Nice!