📦 ftnext / recent-state-summarizer

📄 README.md · 77 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77# recent-state-summarizer

Summarize blog article titles with the OpenAI API

a.k.a. _RSS_ 😃

## Setup

```
$ pip install recent-state-summarizer
```

⚠️ Set `OPENAI_API_KEY` environment variable.  
ref: https://platform.openai.com/account/api-keys

## Usage

```
$ omae-douyo https://nikkie-ftnext.hatenablog.com/archive/2023/4

この人物は最近、プログラミングに関することを中心にして活動しています。

(略)

最近は、株式会社はてなに入社したようです。
```

Currently support:

- はてなブログ(Hatena blog)
- はてなブックマークRSS
- Adventar
- Qiita Advent Calendar

To see help, type `omae-douyo -h`.

### Fetch only (save to file)

Fetch titles and URLs of articles, and save them to a file without summarization:

```
# Save as JSON format (default)
$ omae-douyo fetch https://nikkie-ftnext.hatenablog.com/archive/2023/4 articles.jsonl

# Save as bullet list
$ omae-douyo fetch https://nikkie-ftnext.hatenablog.com/archive/2023/4 titles.txt --as-title-list
```

## Development

### Sub commands

Fetch only (same as `omae-douyo fetch`):

```
python -m recent_state_summarizer.fetch -h
```

Summarize only:  
It's convenient to omit fetching in tuning the prompt.

```
python -m recent_state_summarizer.summarize -h
```

### Environment

```
$ git clone https://github.com/ftnext/recent-state-summarizer.git
$ cd recent-state-summarizer

$ python -m venv venv
$ source venv/bin/activate
(venv) $ pip install -r requirements.lock
(venv) $ pip install -e '.'
```