Skip to content

Instantly share code, notes, and snippets.

@patrickdevivo
Created January 2, 2012 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patrickdevivo/1552372 to your computer and use it in GitHub Desktop.
Save patrickdevivo/1552372 to your computer and use it in GitHub Desktop.
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