Skip to content

marcelhas/whatsapp-chat-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

whatsapp-chat-parser

Warning

This script was written for a course to learn Ruby. For real usecases, you should look at more elaborate/robust implementations like this or this!

Note

Media and attachments are not supported!

Process Whatsapp chat exports programmatically with ruby.

Usage

  1. Export your Whatsapp chat without media
  2. Place the resulting .txt file in the same folder as this README.md
  3. Make sure ruby version >=3 is installed
    • Use the provides nix flake if you can
  4. Create your own driver file (see main.rb for reference usage)
# Define process lambda function.
process = lambda do |msg|
    author  = msg[:author]
    date    = msg[:date]
    content = msg[:content]
    # Do whatever you want with this.
end

# Open file and create parser.
file = File.readlines('input.txt', chomp: true)
parser = Parser.new(file, process_read_fn)

# Start parsing!
parser.parse()
# Execute the script.
ruby your_file.rb

License

MIT License © 2023-Present marcelhas

About

Handle Whatsapp chat exports like objects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published