Storing Facebook friends data into Neo4j with Python and visualizing them using a D3.js graph
This project is an example that shows how to connect to Neo4j from Python, fetch some data from Facebook (your friends) and display your friends' relationships in a graph. This project uses the py2neo module to connect to the Neo4j RESTful interface, the facebook-sdk to fetch data from your Fracebook profile and D3.js (the 'chords' graph) to visualize the data.
- Python 2.7
- Neo4j v2.0
- py2neo
- pythonforfacebook/facebook-sdk
- Facebook Access Token (You will need to register as a Facebook Developer https://developers.facebook.com/apps)
git clone [email protected]:tiepologian/neo4j-facebook-example.git
cd neo4j-facebook-example
(edit neo4j-facebook.py and set YOUR_NAME and YOUR_FB_TOKEN to your full name on Facebook and your access token)
./neo4j-facebook.py
(If there are no errors, follows.json is created. Move it to the chords folder)
mv follows.json chords/
(Move the chords folder to your web server folder, I'm using Apache)
sudo mv chords/ /var/www/
You can view the chords graph from your browser: http://YOUR_IP_ADDRESS/chords