• Stars
    star
    171
  • Rank 222,266 (Top 5 %)
  • Language
    Python
  • Created over 1 year ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

OpenAI's ChatGPT API to create and post a summary of a Slack public channel.

Script for summarizing Slack public channels using ChatGPT

日本語はこちら

by masuidrive @ Bloom&Co., Inc. 2023- APACHE LICENSE, 2.0

This script uses OpenAI's ChatGPT API to create and post a summary of a Slack public channel.

In organizations where the number of channels is increasing, it can be difficult to keep up with reading all the activity. By creating and posting summaries, it is easier to keep track of channel activity.

Most of this code was written using ChatGPT. If you have any better prompts or feature enhancements, please submit a Pull Request.

Please check OpenAI's terms and conditions of information handling for yourself, including the following

https://platform.openai.com/docs/data-usage-policies

If you have any questions, please feel free to contact me on http://twitter.com/masuidrive_en or http://twitter.com/masuidrive.

How to set it up on GitHub Actions

It runs on GitHub Actions every day at 5:00 a.m., so if you want to run it in a different environment, you'll have to figure it out.

Fork it to your own GitHub account

  • Click the "Fork" button in the upper right to fork it to your own repository.
  • Make the GitHub Actions executable by upgrading to a paid plan or some other means.

Edit running time

  • GitHub Actions uses the cron syntax to schedule jobs, which is specified in the .github/workflows/summarizer.yaml file with the minute hour * * * format.
  • Since this is in UTC, you need to adjust for your own time zone.
  • For example, to run the script every day at 5:00 AM in Japan, you would specify 0 20 * * * to run it at 8:00 PM UTC the day before.

Set environment variables

  • Open the "Settings" tab and click "Secrets and variables"->"Actions".
  • Click the green "New Repository Secret" button to set environment variables for the following three variables.

OPEN_AI_TOKEN

  • OpenAI's authentication token
  • Access OpenAI's website.
  • Click the "Sign In" button on the upper right and log in to your account.
  • Click "API Key" from the "API" menu at the top of the page to generate an API key.
  • When you access the "API Key" page, the API key will be displayed. Copy it and paste it into Value.

SLACK_BOT_TOKEN

  • Slack's API authentication token
  • Access the Slack API website and log in.
  • Click "Create a new app" and select "From an app manifest", and copy the following contents to the manifest.
{"display_information":{"name":"Summary","description":"Public channelのサマリーを作る","background_color":"#d45f00"},"features":{"bot_user":{"display_name":"Summary","always_online":false}},"oauth_config":{"scopes":{"bot":["channels:history","channels:join","channels:read","chat:write","users:read"]}},"settings":{"org_deploy_enabled":true,"socket_mode_enabled":false,"token_rotation_enabled":false}}
  • Click "Install App" on the left side of the screen, then click "Install App to Workspace" that appears on the right side to install the app in your workspace. Once the installation is complete, the bot's OAuth access token will be displayed.
  • Copy this token that begins with xoxb- and paste it into Value.

SLACK_POST_CHANNEL_ID

  • The channel_id in Slack where you want to post the summary result
  • Open the Slack channel where you want to post the summary results.
  • Click the channel name at the top and paste the Channel ID, which appears at the bottom of the popup window.

LANGUAGE

  • Specifies the language used for summarization.
  • Any value can be specified, such as "ja" or "Japanese" for Japanese, or "en" or "English" for English.

TIMEZONE

Install the bot in the channel

  • Search for "Summary" in the search window at the top of the screen and click "Summary [APP]".
  • Click "Summary" and click "Add this app to a channel" to specify the channel where you want to post the summary results.

Run

  • Open the "Settings" tab in the GitHub repository, then click "Actions"->"General" on the left side.
  • Select "Allow all actions and reusable workflows" in "Actions permissions" and save it.

With these settings, a summary of Slack's public channels will be posted every day at 5:00 a.m.

you would manually execute it by opening the "Actions" tab, clicking on "Summary" on the left, and clicking "Run workflow" on the right.

More Repositories

1

open-wripe

https://wri.pe source code
Ruby
621
star
2

miyamoto

Google Apps Scriptで書かれたSlack用勤怠管理Botの「みやもとさん」
JavaScript
521
star
3

node-mysql

[obsolete] pure Javascript MySQL network driver for node.js
JavaScript
116
star
4

TiStoreKit

StoreKit(In App Purchase) module for Titanium Mobile iPhone
JavaScript
101
star
5

ti-websocket-client

WebSocket client for Titanium Mobile 1.7.x+
JavaScript
70
star
6

pr_geohash

GeoHash library for pure Ruby
Ruby
64
star
7

TiAdMob4iPhone

AdMob module for Titanium Mobile iPhone
Objective-C
58
star
8

ti-evernote-api

Evernote API bridge for Titanium Mobile
Objective-C
39
star
9

TiMultitouch

Multitouch module for Titanium Mobile
Objective-C
32
star
10

TitaniumSamples

JavaScript
26
star
11

react-starterkit

Reactの開発環境
CoffeeScript
25
star
12

TiHandson

JavaScript
25
star
13

gae-minwiki

100 lines WikiEngine on Google App Engine
JavaScript
10
star
14

colored_eraser

手書きメモアプリの特定色の消せる機能のProof of Concept
JavaScript
10
star
15

TiCustomCamera

Objective-C
10
star
16

follow_me_now

JavaScript
9
star
17

esp-idf-codespaces

Dockerfile
9
star
18

esp-nimble-nordic-uart

NimBLE Nordic UART driver for ESP-IDF
C
9
star
19

TiFacebookExt

Titanium.Facebook extension module for Titanium Mobile for iPhone
Python
9
star
20

TiInAppPurchase

InAppPurchase for Titanium mobile iphone
Python
8
star
21

vagrant-remote

Shell
7
star
22

mobiruby-rubyconf2012

Presentation slides and note for RubyConf 2012 in Denver.
6
star
23

turbo-stimulus-typescript-example

JavaScript
6
star
24

mruby-mindstorms-ev3

mrbgems MINDSTORMS EV3
Ruby
5
star
25

micropython-usbkeyboard

USB keyboard driver that works with MicroPython ESP32-S3
C
4
star
26

oauth2_provider

Ruby
4
star
27

tidocs

tidocs.com
JavaScript
4
star
28

mobiruby-ios

Moved
4
star
29

react-handson-1

JavaScript
4
star
30

juno-with-user-auth-on-gae

juno-with-user-auth-on-gae
Python
3
star
31

wordcards

Ruby
3
star
32

esp-network-config-ble

C
3
star
33

hatena-bookmark-anywhere

ブログにはてブのコメントを表示するhatana_bookmark_anywhere.js
JavaScript
3
star
34

object_extender_rb

Call class statements with extended object. It's without class pollution.
Ruby
2
star
35

journals

HTML
2
star
36

masuidrive.jp

my website
HTML
2
star
37

vsc-esp-updater

TypeScript
2
star
38

masuidrive-test

test for me
2
star
39

mrbgems-example

mrbgems-example
Ruby
2
star
40

node-with-docker

JavaScript
1
star
41

drivecss

Yey another extended CSS
JavaScript
1
star
42

SkyWay-iOS

Ruby
1
star
43

mruby-debug-example

mruby debugger example
C
1
star
44

segmentation-kit-for-ja-full-context-label

音声ファイルと読みのテキストから音素アライメント付きのフルコンテキストラベルファイルを生成する
Python
1
star
45

mruby-debug-step-exec

mruby-debug-step-exec
C
1
star
46

TiMob-Sample1

JavaScript
1
star