- Navigate to
./fb_message_visualization
- Using python3.6 or higher, set up the virtual environment
python -m venv venv;
source venv/bin/activate;
pip install -r requirements.txt
Facebook provides users with the ability to download historical information associated with their account. This script makes use of historical message information. To recover this information from Facebook, follow the below steps:
- Navigate to
https://www.facebook.com/dyi/?referrer=yfi_settings
- Click Deselect All on the Your Information pane, then check the box to the right of Messages.
- Click Create File under the Request Copy pane. (Be sure that the format of the request is HTML)
- It will take Facebook a while to generate this file.
Once you have it, it should be a zipped file with a name in the following format:
facebook_<username>.zip
- Unzip this file and move it to the
./fb_message_visualization
directory.
The operations of the script can be thought as doing the following:
- Compute the temporal range in which all conversations have occurred.
- Divide this range into bins of uniform size (i.e., one bin for each day).
- For each conversation thread with an individual, count the number of exchanged messages occurring in each bin.
- Compute a 4-month moving average over the message counts in these bins.
- Produce a csv file that is compliant with Flourish.
To run the script execute:
python fb_to_ts.py --name="<your_name_on_facebook>" --base-dir="./<name_of_messages_directory>"
where your_name_on_facebook
is whatever your name is listed as on your Facebook Profile (e.g., "Chris Grimm"). This will produce a CSV file titled scores.csv
.
- Go to the url
https://public.flourish.studio/visualisation/2439541/
- Click Duplicate and edit to copy the project.
- Click the Data tab above the visualization.
- Click Upload data and select the scores.csv file.