Code for extracting Facebook Data for research project – http://www.meganknight.uk/uncategorized/social-media-research-project/
This project is developing the research discussed at http://www.meganknight.uk/journalism/social-media-research-project/ and at http://www.meganknight.uk/uncategorized/facebook-and-the-news/
It is built with the Facebook Graph API, and runs on PHP, and a simple mysql database
THe code in this repo works as follows:
- Collects basic consent data from a user (index.php), assigns a unique id and records the consent with that ID.
- Asks the user to sign in to Facebook and accept the app’s conditions (formresult.php).
- Gathers the Facebook user id, checks whether it has already been recorded, and if not records it once in a table.
If it has been used, the process proceeds as normal, but the unique id is tagged as a duplicate record.
- Collects the most recent likes and posts by the user, and their political beliefs and birthday (to calculate age).
- Stores this data in tables, linked to the unique id generated in step 1. This is never linked to the Facebook ID, and there is no way to reconnect the two pieces of data.
- Asks a brief survey of news awareness, and stores those in the database.