lunes, 22 de marzo de 2010

Cloudlight and Facebook friends privacy

I wanted to present Cloudlight, another experimental framework for analysing complex graphs and collecting graph data. It extends NetworkX, a wonderful Python library. As an example the following graph node is able to retrieve Facebook friends and Facebook complete names. You need just python-mechanize to test FacebookNode.friends(). The original source is here.

Disclaimer: Don't abuse otherwise your Facebook account will be banned as usual.


First I show you an example using FacebookNode. You need the complete Cloudlight, or just Networkx and only FacebookNode.

############################################################################
from cloudlight.src.nodes.facebook import FacebookNode
from networkx import Graph
# or from cloudlight.clasess.graph import Graph

FacebookNode.initialize({}, 'mail_for_facebook_login',
'password_for_facebook_login', False)

node = FacebookNode(1151613578)

node.grab_user_details()
print node.name

g = Graph()
node.visit_friends(g, 2)

print map(lambda x : x.name, g.nodes() )

g2 = Graph()
node.visit_friends(g2, 5000, False)

print map( lambda (x,y): (x.id, y.id), g2.edges() )
############################################################################