Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to export a specific thread? #11

Closed
tessus opened this issue Jan 20, 2022 · 13 comments · Fixed by #26
Closed

how to export a specific thread? #11

tessus opened this issue Jan 20, 2022 · 13 comments · Fixed by #26
Labels
enhancement New feature or request

Comments

@tessus
Copy link

tessus commented Jan 20, 2022

I came across this great tool, but I am a bit puzzled as to how to export/dump a specific thread.
Channels can be extremly large and I am intersted in a specific thread. How can I export that thread alone?

In an org with 2000 channels slackdump -c would not give me a specific thread id, or at least I probably won't find it in there.
When I copy a link to a thread in Slack, I get 2 ids in the link. Can I use that info to dump a specific thread? If yes, how?

@tshddx
Copy link

tshddx commented Jan 20, 2022

slackdump -c works for me. It outputs a table like this:

2022/01/20 10:12:32 initializing...
2022/01/20 10:12:32 > caching users...
2022/01/20 10:12:32 > caching channels, might take a while...
2022/01/20 10:12:32 retrieving data...
2022/01/20 10:12:32 done
ID           Arch  Saved  What
C0ABCDE1    arch  saved  #random
C0ABCDE2    -     saved  #general
C0ABCDE3    -     saved  #movies
C0ABCDE4    -     saved  #books

@tessus
Copy link
Author

tessus commented Jan 20, 2022

Hmm, I thought I was clear in my desciption. Take a random channel and start a thread in that channel. Now I want to export this single thread. (The message and all replies to that message (reply in thread)). I do not need the 500,000 other messages in that channel. I only need this single thread.

@tshddx
Copy link

tshddx commented Jan 20, 2022

Oh sorry, you're talking about actual "threads" in Slack. I.e. conversation replies. This command line tool doesn't expose that functionality directly, but it probably wouldn't be too hard to directly expose the dumpThread function. The underlying Slack API method this uses is here: https://api.slack.com/methods/conversations.replies

@tessus
Copy link
Author

tessus commented Jan 20, 2022

Cool, thanks. I will have a look at it when I have a bit more time. If there is an API call available, it shouldn't be too hard to add this to the script (oops, I meant Go app).

@rusq
Copy link
Owner

rusq commented Jan 20, 2022

Hey @tessus, unfortunately currently there's no way currently to dump a specific thread without dumping the whole conversation/channel. Threads support was added recently and there's certainly may ways of improvement. That's a good suggestion, thank you, i'll look into that.

@rusq rusq added the enhancement New feature or request label Jan 20, 2022
@rusq
Copy link
Owner

rusq commented Jan 29, 2022

There's a draft implementation in a url-dl branch, if you want to try it out. I'm just finishing some tests and planning to do some docs as well, when the constellations are properly aligned.

You can check it out with

git pull && git checkout url-dl

compile:

go build ./cmd/slackdump

Or, alternatively use these binaries:
slackdump-linux.zip
slackdump-windows.zip
slackdump-darwin.zip

And then, you'd need to specify the -url command line flag like so:

./slackdump -f -r text -url <URL1> [URL2] ... [URLn]

Alternatively, you could chuck all the URLs you want to fetch to the text file, and run it like so

./slackdump -i all_those_lengthy_urls.txt -f -r text

The URLs can be either of channels or a thread.

Would be great to have some feedback on this before I merge :) If not - that's also fine, i'll just merge as is, after I finish tests.

@tessus
Copy link
Author

tessus commented Jan 29, 2022

Awesome, I will test it in a couple of days.

@rusq
Copy link
Owner

rusq commented Feb 13, 2022

@tessus merged, please use v1.3.0, the readme was updated too!

@tessus
Copy link
Author

tessus commented Feb 13, 2022

I am sorry. I had so many meetings the last 2 weeks that my head was exploding half way through the day. I totally forgot to test and send you feedback. Next week should be a bit better and I will hopefully get to it.

But rest assured I will test this and use it. I really need this feature. ;-)

@rusq
Copy link
Owner

rusq commented Feb 13, 2022

No problem, hope it works for you!

@tessus
Copy link
Author

tessus commented Feb 16, 2022

Yes, it works! Nice.

I have noticed one small issue though. It might not have anything to do with this change though: certain characters are html encoded.

Architecture: `Project` -> `project specific OTel Collector (Gateway)` -> `centralized OTel Collector Gateway` -> `Backend`

turns to

Architecture: `Project` -&gt; `project specific OTel Collector (Gateway)` -&gt; `centralized OTel Collector Gateway` -&gt; `Backend`

@rusq
Copy link
Owner

rusq commented Feb 17, 2022

@tessus thank you! Good catch with escaped characters - fixed it, will be available in 1.3.1, almost done with it, will update the releases in couple of days, just need to do some final testing.

@tessus
Copy link
Author

tessus commented Feb 17, 2022

Great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants