Skip to content

Instantly share code, notes, and snippets.

@LiamDobbelaere
Last active March 12, 2019 17:21
Show Gist options
  • Save LiamDobbelaere/41108b286ee0428f9b89e33c01c142b4 to your computer and use it in GitHub Desktop.
Save LiamDobbelaere/41108b286ee0428f9b89e33c01c142b4 to your computer and use it in GitHub Desktop.
Node oneliner to convert a facebook message.json to a plaintext, alphanumeric chars only
fs.writeFileSync('out.txt', JSON.parse(fs.readFileSync("message.json")).messages.filter(m => m.sender_name == 'Tom Dobbelaere' && m.content.match(/^[0-9a-zA-Z ]+$/)).map(m => m.content).join('\n'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment