https://github.com/keyweeusr/fbmessageparser
:zap: Parse Facebook messages from the downloaded archive
https://github.com/keyweeusr/fbmessageparser
archive facebook message parser
Last synced: 4 months ago
JSON representation
:zap: Parse Facebook messages from the downloaded archive
- Host: GitHub
- URL: https://github.com/keyweeusr/fbmessageparser
- Owner: KeyWeeUsr
- License: mit
- Created: 2017-11-16T08:59:29.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-26T09:07:38.000Z (over 7 years ago)
- Last Synced: 2024-12-28T08:27:49.379Z (5 months ago)
- Topics: archive, facebook, message, parser
- Language: Python
- Size: 5.86 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fbmessageparser
Imagine you download an archive of all the stuff you do on Facebook with your
profile - posts, photos, even messages. Well, messages aren't saved in
a friendly format. This little script parses the messages for you from this
ugly and cluttered format:
Your Profile
Participant 1, Participant 2, ...
Hi
Not now
😂
...
...
to a very simple conversation files (`parsed_conversations/conv_NNNN.txt`):
participant 1, participant 2, ...
=================================
User Name 1 | Day, Full Date at Time Timezone
---------------------------------------------
HiUser Name 2 | Day, Full Date at Time Timezone
---------------------------------------------
Not nowUser Name 1 | Day, Full Date at Time Timezone
---------------------------------------------
😂User Name 1 | Day, Full Date at Time Timezone
---------------------------------------------
### But why?
* Splitting messages. It's better to split into conversation files because
those are better to open even in an editor such as `Notepad` or likes that
will gladly freeze if you try to open a slightly bigger file. Facebook puts
everything into a single file with HTML clutter everywhere.* HTML clutter means larger file. With simplifying the output I personally got
about 20MB down of an original 60MB file. Quite insane, right? ;)* Readability counts. Facebook dumps your messages into a single-line string
therefore you either prettify the HTML and increase the size of the file
massively or open the file in the browser - good luck with large files,
you'll love the smooth scrolling - and copy-paste the conversations manually
out of there - seriously, no one would do that.### How to use
pip install beautifulsoup4
python main.py messages.htmand all the conversations will be splitted to the separate folder
`parsed_conversations` right next to the `main.py` file.#### Note: Python 2 is not supported