-
-
Save bamarch/f6ab45edb1618b183e8a9ebe42a4e78d to your computer and use it in GitHub Desktop.
Clean WhatsApp Generated Text File for Image Cloud Scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Extremely simple script to cleanup the conversation data that WhatsApp generates | |
#You can email yourself the conversation from your WhatsApp mobile application, run this script and use any popular word cloud generator like http://www.wordle.net/create. | |
#TO DO: Include code to create wordcloud as well. Possibly https://github.com/atizo/PyTagCloud or https://github.com/amueller/word_cloud | |
#Usage: python WhatsAppCleaner.py Foo.txt | |
from sys import argv | |
script, filename = argv | |
f = open(filename,'r') | |
for line in f: | |
try: | |
temp = line.split(': ')[1]; | |
if('Media' not in temp): # If any form of media is sent, WhatsApp prints "<Media Omitted>". Getting rid of this. TO DO: Improve this functionality. | |
print temp | |
except: | |
print " " | |
f.close() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment