rusq / slackdump

Save or export your private and public Slack messages, threads, files, and users locally without admin privileges.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for exporting own messages only from timeframe

razvanphp opened this issue · comments

My usecase is rather interesting, but maybe also useful for other freelancers.

I want to be able to export all my messages from last month so I can calculate my hourly timesheet for invoicing.

I can easily select them in search, by choosing from:me and filter:range but pagination is awful and I can't programatically work on the dates and hours.

Thank you!
R

Seems like /api/search.modules.messages endpoint has this functionality, can we use it already with arbitrary parameters/query?

Screenshot 2024-01-11 at 23 00 18

Hey @razvanphp, thank you for the suggestion. I think once I get the v3 out, this would be a great feature to have, I'll add it in v3.1 milestone.

Added in v3.0.0

You can try it by checking out the v3 branch, and running

go run ./cmd/slackdump search messages "search terms supported by slack, i.e. user:@blah"

Yes! it worked, thank you!

Now I have to write my own script for parsing and calculations 🙂

Hey @rusq, tried again the feature and observed a small bug: the output file is not a valid json, it misses the array [] wrapper and , in between the objects. Is this expected?

Screenshot 2024-06-05 at 18 03 21

Otherwise it works great, I published my script as a gist.

slack heatmap 03 2024

Hey @razvanphp , the output file is a valid JSONL document, where each line is a JSON object. This is done to reduce memory usage. If I was to assemble an array of million messages, that would take considerable amount of RAM, so JSONL shifts that problem to the user

commented

Pagination seems to be missing from this search function, I only get the first 70 matches, while there in the app the same search returns 65k messages.

commented

@kisst , thanks, I don't remember there was an issue last time I checked, interesting. I'll have a look.