https://github.com/hasnep/slack-archiver
🗃️ A tool to archive Slack links
https://github.com/hasnep/slack-archiver
archiver slack
Last synced: over 1 year ago
JSON representation
🗃️ A tool to archive Slack links
- Host: GitHub
- URL: https://github.com/hasnep/slack-archiver
- Owner: Hasnep
- License: gpl-3.0
- Created: 2023-06-30T08:56:00.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-02T09:13:09.000Z (almost 3 years ago)
- Last Synced: 2025-01-21T09:27:21.397Z (over 1 year ago)
- Topics: archiver, slack
- Language: Julia
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Slack Archiver
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.
## Setup
### GitHub Token
- [Generate a GitHub token](https://github.com/settings/tokens), select "classic token" and tick the "repo" scope, then generate the token.
- Copy the token and paste into a `.env` file, with the name `GITHUB_TOKEN=...`
### Slack Token
- [Create a new Slack app](https://api.slack.com/apps) 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 name `SLACK_TOKEN=...`
### Configuration
Configuration is specified in a `config.toml` file, the fields are:
- `github_username` - the owner of the repo being used for archiving
- `github_repo_name` - the name of the repo being used for archiving
- `git_name` - the name that will be associated with the git commits
- `git_email` - the email that will be associated with the git commits
- `slack_workspace` - the name of your Slack workspace, e.g. `julialang`
- `github_token_environment_variable` and `slack_token_environment_variable` - optional, the names of the environment variables that will be checked for your tokens, default to `GITHUB_TOKEN` and `SLACK_TOKEN` respectively
## Running
Install the project's dependencies:
```shell
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.
```shell
julia --project=. src/SlackArchiver.jl ./path-to/my-file.md ./path-to/another-file.md
```