A tool to scan files containing Slack links, then archive the conversations in those links to a GitHub repository and replace the Slack links with links to the archives.
- Generate a GitHub token, select "classic token" and tick the "repo" scope, then generate the token.
- Copy the token and paste into a
.env
file, with the nameGITHUB_TOKEN=...
- Create a new Slack app and choose "from an app manifest".
- After choosing the workspace, copy and paste the contents of
./app-manifest.json
- Open your Slack app's basic information page, and press "Install your app", then allow the app to access information.
- Select "OAuth & Permissions" from the app's sidebar and copy the User OAuth token for your workspace, paste it into a
.env
file with the nameSLACK_TOKEN=...
Configuration is specified in a config.toml
file, the fields are:
github_username
- the owner of the repo being used for archivinggithub_repo_name
- the name of the repo being used for archivinggit_name
- the name that will be associated with the git commitsgit_email
- the email that will be associated with the git commitsslack_workspace
- the name of your Slack workspace, e.g.julialang
github_token_environment_variable
andslack_token_environment_variable
- optional, the names of the environment variables that will be checked for your tokens, default toGITHUB_TOKEN
andSLACK_TOKEN
respectively
Install the project's dependencies:
julia --project=. -e 'import Pkg; Pkg.instantiate()'
Then run the src/SlackArchiver.jl
file, passing the paths to files containing Slack links that you want archived.
The files will automatically be overwritten with ones containing the new archived links.
julia --project=. src/SlackArchiver.jl ./path-to/my-file.md ./path-to/another-file.md