Skip to content

Commit

Permalink
Merge pull request #13 from fkubota/feat/readme_v2.0.0
Browse files Browse the repository at this point in the history
Feat/readme v2.0.0
  • Loading branch information
fkubota authored Dec 27, 2020
2 parents 32b06a1 + 594678c commit 0c88257
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 46 deletions.
66 changes: 32 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

前日のarxivから気になる論文にスコアを付けてslackに通知するシステムです。
通知の際に、abstractをDeepLで翻訳しています。
**導入は20minぐらいで終わります!!**
**導入に必要なのはgithubアカウントだけです。10minぐらいで設定は終わります!!**
スコアは、ターゲットとなるキーワードに重み付けをして決まります。(例 resnet=5, kaggle=3, audio=3)
ユーザーが**好きな領域****好きなキーワード**を登録することで、通知される論文は変わります。

Expand All @@ -32,27 +32,11 @@
## Installation
**requirements**
- google chrome
- python3
**step**
1. このリポジトリをフォークする
2. フォークしたリポジトリをクローンする
3. pythonライブラリのインストール
`pip install -r reuirements.txt`
4. Selenium のインストール(Seleniumについては[こちら](https://qiita.com/Chanmoro/items/9a3c86bb465c1cce738a))
- chromeのバージョンの確認をしてください。
- linuxの場合、以下のコマンドで確認できます。
`google-chrome --version`
- webdriverのインストール。chromeのメジャーバージョンだけ抜き取って使います。
- 例) chromeのバージョンが `84.0.4147.105`場合
`pip install chromedriver-binary==84.*`
1. **このリポジトリをフォークする**
- seleniumのインストール
`pip install selenium`
5. webhook urlの取得
2. **webhook urlの取得**
- 特定のslackチャンネルに流すための準備を行います。
- incomming webhookの**webhook url**を取得してください。
- 参考サイト
Expand All @@ -64,14 +48,25 @@
6. webhook urlの設定
- `config.yaml` 内の、`'your webhook url'` を取得したURlに変更します。
3. **webhook urlの設定**
- 2で取得した `webhook url` を設定します。
- 手順
a. `settings` をクリック。
<img src='./data/images/01.png' width='400'>
<img src='./data/images/05.png' width='1000'>
b. `Secrets` をクリック。
c. `New repository secret` をクリック。
7. 領域の設定
d. Nameを `SLACK_ID` と入力。Valueを **step2** で取得した`webhook url`を貼り付けます。
<img src='./data/images/07.png' width='1000'>
e. 最後に`Add secret`をクリックして登録完了です。
4. **領域の設定**
- 通知させたいarxivの論文の領域を指定します。
- (computer scienceの人はこの手順を飛ばしてstep8に進んでも構いません)
- **(computer scienceの人はこの手順を飛ばしてstep8に進んでも構いません)**
- `computer science` なら `cs` などそれぞれに名前がついています。以下の手順で確認します。
- 手順
1. [arxiv.org](https://arxiv.org)にアクセス
Expand All @@ -86,7 +81,9 @@
4. `config.yaml` 内の、`subject` を3で取得した文字列に変更します。(デフォルトでは`cs`になっています。)
8. キーワードの設定
5. **キーワードの設定**
- `config.yaml` にキーワードとそのキーワードのスコアを設定します。
- 例(音に関する論文を通知してほしい場合)
```
Expand All @@ -104,18 +101,19 @@
<img src='./data/images/03.png' width='600'>
9. 動作確認
- 動作確認してみましょう。
1. `cd Carrier-Owl/src`
2. `python3 carrier-owl.py`
- slackに通知が行けば成功です。
6. **通知タイミングの調整**
- デフォルト設定では、日本時間の平日9時50分に通知されるようになっています。この設定で問題ない方はこれで設定完了です。
- 通知タイミングのカスタマイズは、[こちら](https://github.com/fkubota/Carrier-Owl/blob/93e83a4ab7a67b127a3be2a2f1059dbed7dadbf0/.github/workflows/cron.yml#L6)を変更することで可能です。
7. **push**
- ここまでの変更がmasterブランチに反映されていれば、これですべての設定が完了したことになります。次の通知タイミングでslackに通知されます。
10. 定期実行
- cron(linux)を使えば定期実行ができます。
- 設定例(月火水木金の9:50に実行)
- `50 9 * * 1,2,3,4,5 python3 ~/Git/Carrier-Owl/src/carrier-owl.py`
8. **test**
- 試しに動かしてみたい場合は、`master` ブランチから `test-send-to-slack` ブランチを作成してください。`test-send-to-slack` ブランチが作られるとgithub actionsが走るようになっています。
- Actionsタブで様子を確認できます。
<img src='./data/images/08.png' width='800'>
### Reference
- https://qiita.com/fujino-fpu/items/e94d4ff9e7a5784b2987
3 changes: 0 additions & 3 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# slack id
slack_id: 'your webhook url'

# arxivの学問領域の指定
subject: 'cs'

Expand Down
Binary file removed data/.gitignore.swp
Binary file not shown.
8 changes: 0 additions & 8 deletions data/.ipynb_checkpoints/keywords-checkpoint.txt

This file was deleted.

Binary file added data/images/05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/07.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/08.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/carrier-owl.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def get_config():

def main():
config = get_config()
slack = slackweb.Slack(url=os.getenv("SLACK_ID") or config['slack_id']) # 環境変数が設定されていればそちらを、なければ(=Noneなら) config.yml の値を使う
slack = slackweb.Slack(url=os.getenv("SLACK_ID"))
id_list = get_articles_info(config['subject'])
results = serch_keywords(id_list, config['keywords'])
send2slack(results, slack)
Expand Down

0 comments on commit 0c88257

Please sign in to comment.