Skip to content

Conversation

coopwilliams
Copy link

@coopwilliams coopwilliams commented Jan 17, 2020

This fixes the problem that messenger.py could not locate .JSON files in Facebook files exported as recently as 11/05/2019. If one copies the contents of the exported 'messages' folder into 'rawdata/messenger', the files therein are one level too deep to be found. I think Facebook's export style must have changed.

This commit adds one more layer to the search for files, and the messenger parser now finds the .json files that it was missing before.

Example directory structure for reference:
'Chatistics/raw_data/messenger/inbox/usernamehere/message_1.json'

@coopwilliams coopwilliams changed the title parse messenger directory one level more search messenger directory one level more Jan 17, 2020
@mar-muel
Copy link
Collaborator

mar-muel commented Jan 23, 2020

I would prefer to use

glob.glob(os.path.join(file_path, '**', '*.json') recursive=True)

This is supported after Python 3.5+.

@mar-muel mar-muel requested review from mar-muel and removed request for mar-muel January 23, 2020 10:07
@MasterScrat
Copy link
Owner

MasterScrat commented Jan 23, 2020

I'm not sure we should import filtered_threads/ and message_requests/, which are spam, by default. They'll contain dangerous links and lewd language.

I'd prefer to import directly inbox/, and potentially also archived_threads/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants