Skip to content

Commit 2304a76

Browse files
authored
Merge pull request #48 from fkubota/feat/36-v210_readme
Feat/36 v210 readme
2 parents 910ee75 + 85cc62e commit 2304a76

File tree

11 files changed

+89
-40
lines changed

11 files changed

+89
-40
lines changed

README.md

Lines changed: 50 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
伝書フクロウという意味です。
77

88
## About Carrier Owl
9+
910
<img src='./data/images/system.png' width='1000'>
1011

1112
前日のarxivから気になる論文にスコアを付けてslackに通知するシステムです。
@@ -42,21 +43,16 @@
4243
4344
<img src='./data/images/09.png' width='600'>
4445
45-
46-
3. **webhook urlの取得**
47-
- 特定のslackチャンネルに流すための準備を行います。
48-
- incomming webhookの**webhook url**を取得してください。
49-
- 参考サイト
50-
- [公式](https://slack.com/intl/ja-jp/help/articles/115005265063-Slack-での-Incoming-Webhook-の利用)
51-
- [紹介記事](https://qiita.com/vmmhypervisor/items/18c99624a84df8b31008)
52-
- slack通知の時のアイコンが設定できますので、よければこれ使ってください。
53-
- [icon](https://github.com/fkubota/Carrier-Owl/blob/master/data/images/carrier-owl.png)
54-
<img src='./data/images/carrier-owl.png' width='50'>
5546
47+
3. **通知先の設定**
48+
通知したいアプリケーションに応じて設定を行います。いくつでも設定可能です。
49+
50+
- Slackに通知する場合は[こちら](./docs/slack_setup.md)
51+
- LINEに通知する場合は[こちら](./docs/line_setup.md)
5652
5753
5854
4. **webhook urlの設定**
59-
- step3で取得した `webhook url` を設定します。
55+
- step3で取得した `webhook url`(または `line token`) を設定します。
6056
- 手順
6157
6258
a. `settings` をクリック。
@@ -67,29 +63,45 @@
6763
6864
c. `New repository secret` をクリック。
6965
70-
d. Nameを `SLACK_ID` と入力。Valueを **step2** で取得した`webhook url`を貼り付けます。
66+
d. Nameを `SLACK_ID`(または `LINE_TOKEN` ) と入力。Valueを **step2** で取得した`webhook url`(また `line token`)を貼り付けます。
7167
7268
<img src='./data/images/07.png' width='1000'>
7369
7470
e. 最後に`Add secret`をクリックして登録完了です。
7571
7672
5. **領域の設定**
73+
7774
- 通知させたいarxivの論文の領域を指定します。
7875
- **(computer scienceの人はこの手順を飛ばしてstep8に進んでも構いません)**
79-
- `computer science` なら `cs` などそれぞれに名前がついています。以下の手順で確認します。
8076
- 手順
81-
1. [arxiv.org](https://arxiv.org)にアクセス
82-
2. 通知させたい領域の**resent**と書かれた部分をクリック。
83-
84-
<img src='./data/images/02.png' width='400'>
85-
86-
3. 遷移後のページのurlを見て、`list/`と`/recent`に囲われている文字列を使います。
87-
88-
- computer scienceの例: `https://arxiv.org/list/cs/recent`
89-
- この場合、`cs` をこの後利用する。
90-
91-
4. `config.yaml` 内の、`subject` を3で取得した文字列に変更します。(デフォルトでは`cs`になっています。)
92-
77+
1. 以下の表から通知を受け取りたいsubjectを選択して、urlをクリックしてください。
78+
79+
| subject | category | url |
80+
| ------------------------------------------ | -------- | ----------------------------------------- |
81+
| Astrophysics | astro-ph | [url](https://arxiv.org/archive/astro-ph) |
82+
| Condensed Matter | cond-mat | [url](https://arxiv.org/archive/cond-mat) |
83+
| Physics | physics | [url](https://arxiv.org/archive/physics) |
84+
| Mathematics | math | [url](https://arxiv.org/archive/math) |
85+
| Nonlinear Sciences | nlin | [url](https://arxiv.org/archive/nlin) |
86+
| Computer Science | cs | [url](https://arxiv.org/archive/cs) |
87+
| Quantitative Biology | q-bio | [url](https://arxiv.org/archive/q-bio) |
88+
| Quantitative Finance | q-fin | [url](https://arxiv.org/archive/q-fin) |
89+
| Statistics | stat | [url](https://arxiv.org/archive/stat) |
90+
| Electrical Engineering and Systems Science | eess | [url](https://arxiv.org/archive/eess) |
91+
| Economics | econ | [url](https://arxiv.org/archive/econ) |
92+
93+
2. さらに細かい分類を確認します
94+
- 以下の例は、subject = `cs` をクリックした場合です。`cs.AI` や `cs.CL` などが細かな分類になります。
95+
96+
<img src='./data/images/10.png' width='600'>
97+
98+
3. `config.yaml` 内の、`subject` を2で確認した文字列に変更します。
99+
- デフォルトでは`cat:cs.*`になっています。これは、cs以下の小分類すべてを通知するという設定になります。
100+
- **複数領域指定**
101+
- 複数領域指定も可能です。以下のよう `OR` でつなぎます。
102+
- ex1) `cat:cs.AI OR cat:cs.CV`
103+
- ex2) `cat:physics.* OR cat:cs.*`
104+
- ex3) `cat:physics.space-ph OR cat:cs.AI OR cat:q-bio.BM`
93105
94106
95107
6. **キーワードの設定**
@@ -119,11 +131,20 @@
119131
- ここまでの変更がmasterブランチに反映されていれば、これですべての設定が完了したことになります。次の通知タイミングでslackに通知されます。
120132
121133
9. **test**
122-
- 試しに動かしてみたい場合は、`master` ブランチから `test-send-to-slack` ブランチを作成してください。`test-send-to-slack` ブランチが作られるとgithub actionsが走って問題なければ通知されるはずです。
123-
- Actionsタブで様子を確認できます。
134+
- github actions の `workflow_dispatch` を使って通知タイミングを待たずにいつでも実行することができます。
135+
- Actionsタブでから、`Run workflow` をクリックすることでいつでも実行可能です。
136+
137+
<img src='./data/images/11.png' width='800'>
124138
125-
<img src='./data/images/08.png' width='800'>
139+
## その他の設定
140+
- **score threshold**
141+
通知するスコアに閾値を設定することができます。`score >= scrore_threshold` を満たす論文のみ通知させることができま
142+
す。 `config.yaml` 内の、`score_threshold` で設定できます(デフォルトは0になっています)。
126143
127144
128145
## Thanks
129-
- [hppさん](https://github.com/hppRC)のお力をお借りして、v2.0.0から `github` だけで動作するようになりました。ご協力ありがとうございました。
146+
- [hppさん](https://github.com/hppRC)のPRにより、github actionsを使うことにより `github` だけで動作するようになりました。
147+
148+
- [wakamezakeさん](https://github.com/wakamezake)のPRにより、arxiv-apiを導入しました。
149+
150+
- [amagaeruさん](https://github.com/amagaeru1113)のPRにより、LINE通知機能を実装しました。

config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# arxivの学問領域の指定
2-
subject: 'cs.*'
2+
subject: 'cat:cs.*'
33

44
# 検索キーワード
55
keywords:

data/carrier-owl.gvdesign

16.5 KB
Binary file not shown.

data/images/10.png

131 KB
Loading

data/images/11.png

78.6 KB
Loading

data/images/line/001.png

284 KB
Loading

data/images/line/002.jpg

192 KB
Loading

data/images/system.png

-7.63 KB
Loading

docs/line_setup.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
**LINE通知導入手順**
2+
3+
1. LINE Notify(https://notify-bot.line.me/ja/) にアクセスし、ログイン
4+
5+
2. ページ右上にある自分の名前をクリックし、マイページに移動
6+
7+
3. マイページ下部でアクセストークン発行
8+
9+
- 下記ページで発行
10+
11+
<img src='../data/images/line/001.png' width='600'>
12+
13+
- 発行時、通知するトークルームを設定できるので同じトークルームに入っている複数名に通知可能
14+

docs/slack_setup.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
**webhook urlの取得**
2+
3+
特定のslackチャンネルに流すための準備を行います。
4+
5+
1. incomming webhookの**webhook url**を取得してください。
6+
- 参考サイト
7+
- [公式](https://slack.com/intl/ja-jp/help/articles/115005265063-Slack-での-Incoming-Webhook-の利用)
8+
9+
- [紹介記事](https://qiita.com/vmmhypervisor/items/18c99624a84df8b31008)
10+
11+
2. slack通知の時のアイコンが設定できますので、よければこれ使ってください。
12+
- [icon](https://github.com/fkubota/Carrier-Owl/blob/master/data/images/carrier-owl.png)
13+
14+
<img src='../data/images/carrier-owl.png' width='50'>
15+

src/carrier_owl.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,14 @@ def notify(results: list, slack_id: str, line_token: str) -> None:
9191
word = result.words
9292
score = result.score
9393

94-
text = f'''
95-
\n score: `{score}`
96-
\n hit keywords: `{word}`
97-
\n url: {url}
98-
\n title: {title}
99-
\n abstract:
100-
\n \t {abstract}
101-
\n {star}
102-
'''
94+
text = f'\n score: `{score}`'\
95+
f'\n hit keywords: `{word}`'\
96+
f'\n url: {url}'\
97+
f'\n title: {title}'\
98+
f'\n abstract:'\
99+
f'\n \t {abstract}'\
100+
f'\n {star}'
101+
103102
send2app(text, slack_id, line_token)
104103

105104

@@ -171,7 +170,7 @@ def main():
171170
yesterday = datetime.datetime.today() - datetime.timedelta(days=1)
172171
yesterday_str = yesterday.strftime('%Y%m%d')
173172
# datetime format YYYYMMDDHHMMSS
174-
arxiv_query = f'{subject} AND ' \
173+
arxiv_query = f'({subject}) AND ' \
175174
f'submittedDate:' \
176175
f'[{yesterday_str}000000 TO {yesterday_str}235959]'
177176
articles = arxiv.query(query=arxiv_query,

0 commit comments

Comments
 (0)