Giter Site home page Giter Site logo

facebookactivitygrapher's Introduction

Facebook Activity Grapher

A script to parse Facebook's personal data export and generate a few descriptive charts.

How it works

Facebook's data export consists of a dozen JSON files in different folders based on what type of activity they track. The format for each is similar - an object with one key, which has a list of objects with information about the activity.

Activity Grapher's first step is to open each of these JSON files, get the list of activities, and map them to a common set of keys. These are yield to a parent function, which inserts them into a SQLite database. SQLite is just used as an intermediary - the event log could easily be written to a CSV, or probably kept in memory, but having a simple database makes adding charts easier.

Next, a few cleanup scripts are run - converting timestamps to dates, guessing when removed friends may have first been added, and mapping friends into groups.

Finally, we use matplotlib to create a handful of explanatory graphs:

  1. Timeline of actions by month
  2. % of actions that are Likes by month
  3. Balance of posts on your wall vs. posts on friends walls
  4. Total friends over time
  5. Total friends over time by group (provided during mapping)

Downloading your data from Facebook

To get your data from Facebook, follow these steps:

  1. On Facebook go to Settings
  2. Click on Your Facebook Information, then Download Your Information
  3. Click Create File. Facebook will let you know when it's ready, then you can download and unzip.

Running Activity Grapher

Download fb_parse.py and fb_sql.py, and move them into the unzipped Facebook data folder. In the command line, run fb_parse.py and follow the prompts.

Dependancies

This was written in Python 3.6, with numpy and matplotlib (>=2.0).

facebookactivitygrapher's People

Contributors

hshore29 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.