fql

Simple Facebook FQL queries for Node

Deprecated: fql is deprecated!
Last updated 7 years ago by hughsk .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install fql 
SYNC missed versions from official npm registry.

node-fql

Jump into the Facebook Graph API with simpler FQL queries for Node.

Installation

npm install fql

Usage

A basic query to a particular Facebook page can be made like so:

var fql = require('fql');

fql.query('SELECT name, fan_count FROM page WHERE page_id = 19292868552', function(err, data) {
	if (err) {
		throw err;
	}
	console.log(data); // [ { name: 'Facebook Platform', fan_count: 4549532 } ]
});

If you need to throw in an access token for non-anonymous queries, just pass it in as an option:

var fql = require('fql');

fql({
	token: '112341534737288|LbWu8xrqWzW5h40LmTLrbU42Qx8'
}).query('SELECT name FROM user WHERE uid = me()', function(err, data) {
	if (err) {
		throw err;
	}
	console.log(data); // [ { name: 'John Doe' } ]
});

You can make multiple queries in one request by passing a JSON object instead of a string too:

var fql = require('fql');

fql.query({
	facebook: 'SELECT name FROM page WHERE page_id = 19292868552',
	coke: 'SELECT name FROM page WHERE page_id = 40796308305'
}, function(err, data) {
	/* `data` should be:
		{
			coke: [ { name: 'Coca-Cola' } ],
			facebook: [ { name: 'Facebook Platform' } ]
		}
	*/
});

Contributors

Current Tags

  • 0.1.2                                ...           latest (7 years ago)

8 Versions

  • 0.1.2 [deprecated]           ...           7 years ago
  • 0.1.1 [deprecated]           ...           7 years ago
  • 0.1.0 [deprecated]           ...           7 years ago
  • 0.0.6 [deprecated]           ...           8 years ago
  • 0.0.5 [deprecated]           ...           9 years ago
  • 0.0.4 [deprecated]           ...           9 years ago
  • 0.0.3 [deprecated]           ...           9 years ago
  • 0.0.2 [deprecated]           ...           9 years ago
Downloads
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 1
Last Month 4
Dependencies (0)
None
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |