Mining your posts

After introducing the Python facebook-sdk with a simple example, we will start digging into the data mining opportunities. The first exercise is to download our own posts (that is, the posts published by the authenticated user).

The script connects to the Graph API and gets a list of posts published by the authenticated user me. The posts are saved in the my_posts.jsonl file using the JSON Lines format that we have already adopted in Chapter 2, #MiningTwitter - Hashtags, Topics, and Time Series, and Chapter 3, Users, Followers, and Communities on Twitter, (each line of the file is a JSON document):

# Chap04/ import os import json import facebook import requests if __name__ == '__main__': ...

Get Mastering Social Media Mining with Python now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.