whatsapp-archive icon indicating copy to clipboard operation
whatsapp-archive copied to clipboard

Create html output by date (not an issue)

Open deadbone opened this issue 5 years ago • 10 comments

Hi,

First at all, thank you for your script, it's very easy to use :) I've just a question : would it be very difficult to create output by date (many files) instead just one ? I'm a noob with python :)

Regards

deadbone avatar Oct 28 '19 07:10 deadbone

Is the idea that you would get a single HTML file from multiple .txt files? I could change the script arguments to something like:

./whatsapp_archive.py -o output.html input1.txt input2.txt input3.txt input4.txt ...

But in the meantime, perhaps you could concatenate / join the .txt files and feed them to the script as if they were one file?

automaciej avatar Oct 30 '19 15:10 automaciej

Hello, No, it's the opposite ;) I've a huge export with many and many days of chat. And it would be easier to read many smaller file by date.

Example with a chat.txt which contains chats from 2019-10-29 and 2019-10-30 ./whatsapp_archive.py -I chat.txt -o output -s

Will provide :

output-2019-10-29.html output-2019-10-30.html

The "-s" argument would be optional

Sorry if my explanation was not accurate :)

deadbone avatar Oct 30 '19 15:10 deadbone

What's the larger goal here? By splitting the archive into separate files, you're solving a problem. What problem is it?

automaciej avatar Nov 09 '19 09:11 automaciej

The archive is one big file with many and many days of conversation. What I want to do is to have at the end with a script, to format a chat (like with your script) but obtain one file a day. And like I wrote in the title, it’s not a issue with your script, juste an idea of option. You seems to know python a way more of me, it’s why I asked if you think if it’s possible to do. Sorry to bother you with that :)

deadbone avatar Nov 09 '19 13:11 deadbone

@deadbone Right, this sounds like functionality on the formatting side. But… I'm still smelling the XY problem here, what is the reason that you want each day in a separate file? Is the complete export too large and your computer freezes up? Is the scroll bar too small? Or you want a way to jump to a given date? Or something else?

automaciej avatar Nov 28 '19 14:11 automaciej

Hi, Yes I would like to jump to a specific date easily. So I thought a split by day per file would be a good answer but if you have a better alternative, I’m in :-)

deadbone avatar Nov 28 '19 15:11 deadbone

HTML already has functionality for jumping around: links!

A list of days on top of the file (like a TOC) would allow you to jump to a specific date.

TOC

2019-11-29 (link) 2019-11-30 (link) 2019-12-01 (link)

2019-11-29

Alice: So how have you been? …

2019-11-30

Bob: (…) (…)

How does that look?

automaciej avatar Nov 29 '19 11:11 automaciej

Hi It would be great :-) Regards

deadbone avatar Nov 29 '19 13:11 deadbone

By the Way, thanks for the link about the XY problem

deadbone avatar Nov 29 '19 13:11 deadbone

I took a stab at it this weekend, but didn't manage to finish it.

automaciej avatar Dec 02 '19 00:12 automaciej