Skip to content

Commit 83c6cc6

Browse files
authored
Merge pull request #14 from fkubota/dev/master
Dev/master
2 parents f63193a + 0c88257 commit 83c6cc6

File tree

11 files changed

+395
-47
lines changed

11 files changed

+395
-47
lines changed

.github/workflows/cron.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Carrier Owl
2+
3+
on:
4+
schedule:
5+
# github actions のデフォルトの time zone が UTC なので、日本時間 - 9時間 した値を書く
6+
- cron: '50 0 * * 1,2,3,4,5'
7+
8+
push:
9+
branches:
10+
- test-send-to-slack
11+
12+
jobs:
13+
ci:
14+
runs-on: ubuntu-18.04
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: actions/setup-python@v2
18+
with:
19+
python-version: 3.8
20+
21+
- name: Run image
22+
uses: abatilo/[email protected]
23+
with:
24+
poetry-version: 1.1.2
25+
26+
- name: install dependencies
27+
run: poetry install
28+
29+
- name: Run owl
30+
run:
31+
poetry run python src/carrier-owl.py
32+
env:
33+
SLACK_ID: ${{ secrets.SLACK_ID }}
34+
35+

README.md

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

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

@@ -32,27 +32,11 @@
3232
3333
3434
## Installation
35-
**requirements**
36-
- google chrome
37-
- python3
3835
3936
**step**
40-
1. このリポジトリをフォークする
41-
2. フォークしたリポジトリをクローンする
42-
3. pythonライブラリのインストール
43-
`pip install -r reuirements.txt`
44-
4. Selenium のインストール(Seleniumについては[こちら](https://qiita.com/Chanmoro/items/9a3c86bb465c1cce738a))
45-
- chromeのバージョンの確認をしてください。
46-
- linuxの場合、以下のコマンドで確認できます。
47-
`google-chrome --version`
48-
- webdriverのインストール。chromeのメジャーバージョンだけ抜き取って使います。
49-
- 例) chromeのバージョンが `84.0.4147.105`場合
50-
`pip install chromedriver-binary==84.*`
37+
1. **このリポジトリをフォークする**
5138
52-
- seleniumのインストール
53-
`pip install selenium`
54-
55-
5. webhook urlの取得
39+
2. **webhook urlの取得**
5640
- 特定のslackチャンネルに流すための準備を行います。
5741
- incomming webhookの**webhook url**を取得してください。
5842
- 参考サイト
@@ -64,14 +48,25 @@
6448
6549
6650
67-
6. webhook urlの設定
68-
- `config.yaml` 内の、`'your webhook url'` を取得したURlに変更します。
51+
3. **webhook urlの設定**
52+
- 2で取得した `webhook url` を設定します。
53+
- 手順
54+
a. `settings` をクリック。
6955
70-
<img src='./data/images/01.png' width='400'>
56+
<img src='./data/images/05.png' width='1000'>
57+
58+
b. `Secrets` をクリック。
59+
c. `New repository secret` をクリック。
7160
72-
7. 領域の設定
61+
d. Nameを `SLACK_ID` と入力。Valueを **step2** で取得した`webhook url`を貼り付けます。
62+
63+
<img src='./data/images/07.png' width='1000'>
64+
65+
e. 最後に`Add secret`をクリックして登録完了です。
66+
67+
4. **領域の設定**
7368
- 通知させたいarxivの論文の領域を指定します。
74-
- (computer scienceの人はこの手順を飛ばしてstep8に進んでも構いません)
69+
- **(computer scienceの人はこの手順を飛ばしてstep8に進んでも構いません)**
7570
- `computer science` なら `cs` などそれぞれに名前がついています。以下の手順で確認します。
7671
- 手順
7772
1. [arxiv.org](https://arxiv.org)にアクセス
@@ -86,7 +81,9 @@
8681
8782
4. `config.yaml` 内の、`subject` を3で取得した文字列に変更します。(デフォルトでは`cs`になっています。)
8883
89-
8. キーワードの設定
84+
85+
86+
5. **キーワードの設定**
9087
- `config.yaml` にキーワードとそのキーワードのスコアを設定します。
9188
- 例(音に関する論文を通知してほしい場合)
9289
```
@@ -104,18 +101,19 @@
104101
105102
<img src='./data/images/03.png' width='600'>
106103
107-
9. 動作確認
108104
109-
- 動作確認してみましょう。
110-
1. `cd Carrier-Owl/src`
111-
2. `python3 carrier-owl.py`
112-
- slackに通知が行けば成功です。
105+
6. **通知タイミングの調整**
106+
- デフォルト設定では、日本時間の平日9時50分に通知されるようになっています。この設定で問題ない方はこれで設定完了です。
107+
- 通知タイミングのカスタマイズは、[こちら](https://github.com/fkubota/Carrier-Owl/blob/93e83a4ab7a67b127a3be2a2f1059dbed7dadbf0/.github/workflows/cron.yml#L6)を変更することで可能です。
108+
109+
7. **push**
110+
- ここまでの変更がmasterブランチに反映されていれば、これですべての設定が完了したことになります。次の通知タイミングでslackに通知されます。
113111
114-
10. 定期実行
115-
- cron(linux)を使えば定期実行ができます。
116-
- 設定例(月火水木金の9:50に実行)
117-
- `50 9 * * 1,2,3,4,5 python3 ~/Git/Carrier-Owl/src/carrier-owl.py`
112+
8. **test**
113+
- 試しに動かしてみたい場合は、`master` ブランチから `test-send-to-slack` ブランチを作成してください。`test-send-to-slack` ブランチが作られるとgithub actionsが走るようになっています。
114+
- Actionsタブで様子を確認できます。
118115
116+
<img src='./data/images/08.png' width='800'>
119117
120118
### Reference
121119
- https://qiita.com/fujino-fpu/items/e94d4ff9e7a5784b2987

config.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# slack id
2-
slack_id: 'your webhook url'
3-
41
# arxivの学問領域の指定
52
subject: 'cs'
63

data/.gitignore.swp

-12 KB
Binary file not shown.

data/.ipynb_checkpoints/keywords-checkpoint.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

data/images/05.png

15.6 KB
Loading

data/images/07.png

47.7 KB
Loading

data/images/08.png

61.8 KB
Loading

0 commit comments

Comments
 (0)