Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
fbGrowl
var https = require('https');
var url = require('url');
var util = require('util');
var exec = require('child_process').exec;
var fb_user_id =;
var fb_access_token = '';
var path = '/' + fb_user_id + '/notifications/' + '?access_token=' + fb_access_token;
var options = {
host: 'graph.facebook.com',
port: 443,
path: path
};
https.get(options, function(res) {
var body = '';
res.on('data', function(chunk) {
body += chunk;
});
res.on('end', function(){
var notifications = JSON.parse(body).data;
var image = '~/Dropbox/fbGrowler/fb.png';
for (i in notifications) {
var message = notifications[i].title;
var title = 'New FaceBook Notification'
var notify = "growlnotify -m '"+message+"' -t '"+title+"' -I '"+image+"'";
exec(notify);
console.log(notify);
}
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment