Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dodonki1223/qiita_trend_slack_notifier
qiita_trendを使用したslack通知スクリプト
https://github.com/dodonki1223/qiita_trend_slack_notifier
qiita qiita-trend-slack ruby slack slack-bot
Last synced: 24 days ago
JSON representation
qiita_trendを使用したslack通知スクリプト
- Host: GitHub
- URL: https://github.com/dodonki1223/qiita_trend_slack_notifier
- Owner: dodonki1223
- Created: 2019-08-06T01:03:27.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-11-14T09:24:17.000Z (over 1 year ago)
- Last Synced: 2025-01-08T23:32:28.062Z (about 1 month ago)
- Topics: qiita, qiita-trend-slack, ruby, slack, slack-bot
- Language: Ruby
- Size: 2.01 MB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# qiita_trend_slack_notifier
`qiita_trend`gemを使用したSlack通知用のスクリプトです

## 使用方法
### Slackアプリの登録
まずは通知させるための[Slack App](https://api.slack.com/apps)を作成します。
[Slack App](https://api.slack.com/apps)リンクをクリックしてページに遷移して下さい。
`Create New App`をクリックします。

`App Name`,`Development Slack Warkspace`を記述して`Create App`をクリックします。

`Incoming Webhooks`をクリックします。

`Off→On`に変更し、`Add New Webhook to Workspace`をクリックします。

`投稿先`を設定してインストールします。

`copy`をクリックすることでWebhook用のURLをコピーできます。
### WebHookURLとQiitaにログインするためのユーザーとパスワードの設定を行う
`config.rb`を書き換えます
WeeklyとMonthlyを使用しない場合はユーザー名とパスワードの設定は必要ありません```ruby
# frozen_string_literal: truerequire 'qiita_trend'
require './qiita_notifier/configuration'QiitaNotifier.configure do |config|
# Qiitaでログイン出来るユーザー名とパスワードをセットしてください
config.user_name = 'user_name' ← Qiitaにログインするユーザー名
config.password = 'password' ← Qiitaにログインするパスワード
# Slackで作成したアプリのWebHookURLを設定してください
config.web_hook_url = 'web_hook_url' ← 設定したWebHookURL
# config.channel = '' ⇐ channelを任意選択したい場合に設定してください
endQiitaTrend.configure do |config|
config.user_name = QiitaNotifier.configuration.user_name
config.password = QiitaNotifier.configuration.password
end
```### 実行コマンド
```shell
# dailyのトレンドをSlackに通知
$ ruby notify_trend.rb# dailyのトレンドでNEWのものだけをSlackに通知
$ ruby notify_trend.rb --new# personalのトレンドをSlackに通知
$ ruby notify_trend.rb -t personal# personalのトレンドでNEWのものだけをSlackに通知
$ ruby notify_trend.rb -t personal --new
```