Created
January 2, 2012 22:22
-
-
Save patrickdevivo/1552372 to your computer and use it in GitHub Desktop.
fbGrowl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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