Create pretty visual word clouds using PyTagCloud from a Facebook message history.
-
Install PyTagCloud.
-
Install the Python SDK for Facebook. You need to use my fork as I added some paging functions that were not present in the old sdk.
-
Get a Facebook access token with permission to read the user's inbox from here. Eventually I will sort of Facebook permissions properly. Save this in the root project directory as access_token.txt.
-
Run as:
$ python word-cloud "John Smith"
-
Admire the word cloud generated at cloud.png.
Currently the code works for most users. Occasionally I find that the Facebook API returns empty messages for some users and I haven't yet found a way to fix this.