]> Sergey Matveev's repositories - feeder.git/blob - doc/usage.texi
Rebranding
[feeder.git] / doc / usage.texi
1 @node Usage
2 @unnumbered Usage
3
4 How @strong{I} use it:
5
6 @table @asis
7
8 @item Get its source code
9
10 @example
11 $ git clone git://git.stargrave.org/feeder.git
12 $ cd feeder
13 @end example
14
15 @item Compile @command{feed2mdir} utility
16
17 @example
18 $ ( cd cmd/feed2mdir ; go build )
19 @end example
20
21 @item Create feeds state directories
22
23 You can create feeds subdirectories under @file{feeds/} manually:
24
25 @example
26 $ mkdir -p feeds/my_first_feed/@{cur,new,tmp@}
27 $ echo http://example.com/feed.atom > feeds/my_first_feed/url
28 @end example
29
30 or convert Newsboat @file{urls} file (containing many lines with URLs)
31 with @command{urls2feeds.zsh} to subdirectories hierarchy:
32
33 @example
34 $ ./urls2feeds.zsh < ~/.newsboat/urls
35 $ cat feeds/blog.stargrave.org_russian_feed.atom/url
36 http://blog.stargrave.org/russian/feed.atom
37 @end example
38
39 @command{urls2feeds.zsh} won't touch already existing directories and will
40 warn if some of them disappeared from @file{urls}.
41
42 @item Check configuration options
43
44 @file{cmd/env.rc} contains list of various options you can override by
45 environment variables, like @command{curl}, @command{wget},
46 @command{zstd}, @command{parallel} command invocations,
47 @code{User-Agent}, number of download/parse jobs run in parallel and so on.
48
49 @item Download your feed(s) data
50
51 @example
52 $ cmd/download.sh feeds/blog.stargrave.org_russian_feed.atom
53 $ ./feeds-download.zsh # to invoke parallel downloading of everything
54 @end example
55
56 Probably you want to change its default @env{$PROXY} value. It uses
57 @command{curl}, that is aware of @code{If-Modified-Since} and
58 @code{ETag} headers, compressed content encodings and HTTP redirections.
59 If you want to see verbose output, then set @env{FEEDER_CURL_VERBOSE=1}.
60
61 @item Parse your feeds
62
63 @example
64 $ cmd/parse.sh feeds/blog.stargrave.org_russian_feed.atom
65 $ ./feeds-parse.zsh # to parse all feeds in parallel
66 @end example
67
68 @item Download-n-parse
69
70 You can also download and parse the feeds immediately:
71
72 @example
73 $ ./feeds-dnp.zsh
74 @end example
75
76 @item Quick overview of the news:
77
78 @example
79 $ ./feeds-news.zsh
80 habr.com_ru_rss_interesting: 7
81 habr.com_ru_rss_news: 3
82 lobste.rs_rss: 3
83 naked-science.ru_?yandex_feed=news: 1
84 planet.fsfe.org_atom.xml: 1
85 www.astronews.ru_astronews.xml: 1
86 www.darkside.ru_news_rss: 5
87 @end example
88
89 @item Run Mutt
90
91 @example
92 $ ./feeds-browse.sh
93 @end example
94
95 That will read all feeds titles and create @file{mutt.rc} sourceable
96 configuration file with predefined helpers and @code{mailboxes}
97 commands.
98
99 That configuration contains @code{auto_view text/html}, that expects
100 proper @file{mailcap} configuration file with @code{text/html} entry to
101 exists. Mutt has some built-in default search paths for, but you can
102 override them with @env{$MAILCAPS} environment variable. There is
103 example @file{contrib/mailcap}.
104
105 Mutt will be started in mailboxes browser mode (I will skip many entries):
106
107 @verbatim
108   1   N [  1|101] 2021-02-17 20:41 Cryptology ePrint Archive/
109   3     [  0|  8] 2021-12-02 19:28 Thoughts/
110  32     [  0|  8] 2021-02-17 19:32 apenwarr/
111 101     [ 10| 50] 2021-02-14 13:40 Блог Stargrave на русском comments/
112 102     [  0| 51] 2021-02-17 19:37 Блог Stargrave на русском/
113 316     [  0| 44] 2021-02-17 19:33 Eaten By A Grue: Infocom, Text Adventures, and Interactive Fiction/
114 @end verbatim
115
116 ePrint has new entries since last downloading/parsing. Stargrave's blog
117 comments have nothing new, but still ten unread entries.
118
119 If we open "Eaten By A Grue" mailbox, then will see its entries:
120
121 @verbatim
122    1     [2021-01-30 11:00] Zork Zero: The Revenge of Megaboz (0,8K)
123    2     [2021-06-12 11:01] Journey: The Quest Begins (0,8K)
124    3     [2021-04-28 11:00] Eaten By A Cruise (0,8K)
125 [...]
126 ---Mutt: feeds/monsterfeet.com_grue.rss [Nachr:44 60K]---
127 @end verbatim
128
129 @item Press @code{q} to return to mailbox browser again
130
131 This is made for convenience, because you will often switch your
132 mailboxes (feeds), but @code{q} quits Mutt by default.
133
134 @item Press @code{A} to mark all messages read
135
136 And again this is made for convenience. It will mark both new
137 (@strong{N}) and old-but-unread (@strong{O}) messages as read. You will
138 see left tag-marks near each message to understand what was touched.
139
140 @item Press @code{o} to open links and enclosures URLs
141
142 Do it in pager mode and you message will be piped to
143 @command{cmd/x-urlview.sh}, that will show all @code{X-URL}
144 and @code{X-Enclosure} links.
145
146 @item Index your messages
147
148 @example
149 $ ./feeds-index.sh
150 @end example
151
152 That will create @file{mu/} and @file{search/} directories and run
153 @command{mu index} indexing, that is safely can be done incrementally
154 after each download/parse cycle.
155
156 @item Search something
157
158 Press @code{<F8>} in Mutt's index and enter your mu/Xapian search query.
159 Let's search for articles mentioning
160 @url{https://en.wikipedia.org/wiki/Planetfall, Planetfall} during
161 2019-2021 period: @code{Planetfall date:2019..2021}. @command{mu} will
162 create symbolic links in @file{search/} subdirectory to the message. Press
163 @code{<F9>} to switch that mailbox:
164
165 @verbatim
166    1 [2021-12-20 07:08] Missed Classic: Stationfall - When Food Dispensers Attack (The Adventurers Guild)
167    2 [2021-11-20 04:52] Missed Classic 102: Stationfall - Introduction (1987) (The Adventurers Guild)
168    3 [2021-11-19 17:54] Boffo Games (The Digital Antiquarian)
169    4 [2021-10-30 23:05] Missed Classic 100: The Manhole (1988) (The Adventurers Guild)
170    5 [2020-05-17 22:16] Round 04 Reveal (unWinnable State)
171    6 [2020-05-16 22:29] Round 03 Reveal (unWinnable State)
172    7 [2020-04-20 11:00] Planetfall (Eaten By A Grue: Infocom, Text Adventures, and Interactive Fiction)
173    8 [2020-04-09 11:00] Beyond Zork (Eaten By A Grue: Infocom, Text Adventures, and Interactive Fiction)
174 -%-Mutt: =search [Nachr:8 215K]---
175 @end verbatim
176
177 Pay attention that there is different index format, lacking unnecessary
178 message flags display and adding name of the feed in parenthesis.
179
180 @item Cleanup excess number of messages
181
182 By default (@env{$FEEDER_MAX_ITEMS}) only 100 entries are processed.
183 Parser only appends them, but does not remove obsolete ones.
184
185 @example
186 $ ./feeds-clear.zsh
187 $ cmd/clear.zsh feeds/FEED # to clear single feed
188 @end example
189
190 will clear everything exceeding the quantity limit. You can set that
191 limit on per-feed basis. For example @code{echo 50 > feed/FEED/max}.
192 0 means no limit and keep all the messages.
193
194 Pay attention that @file{new/} directory is not touched, so you won't
195 loose completely new and unread messages when you are on vacation and
196 left @command{cron}-ed workers.
197
198 @item If you want to clean download state
199
200 @example
201 $ cmd/download-clean.sh feed/FEED
202 @end example
203
204 @anchor{Enclosures}
205 @item Download enclosures
206
207 Many feeds include links to so-called enclosures, like audio files for
208 podcasts. While you mail is not processed by MUA, its @file{new/}
209 messages still there, you can run enclosure downloading process, that
210 uses @url{https://www.gnu.org/software/wget/, GNU Wget}. Each
211 enclosure's filename is more or less filesystem-friendly with the
212 current timestamp in it.
213
214 @example
215 $ ./feeds-encs.zsh
216 [...]
217 monsterfeet.com_grue.rss/encs/20220218-152822-traffic.libsyn.com_monsterfeet_grue_018.mp3
218 www.astronews.ru_astronews.xml/encs/20220219-115710-www.astronews.ru_news_2022_20220216125238.jpg
219 [...]
220 $ file feeds/**/encs/*/
221 monsterfeet.com_grue.rss/encs/20220218-152822-traffic.libsyn.com_monsterfeet_grue_018.mp3:
222   Audio file with ID3 version 2.2.0, contains:MPEG ADTS, layer III, v1,  96 kbps, 44.1 kHz, Monaural
223 www.astronews.ru_astronews.xml/encs/20220219-115710-www.astronews.ru_news_2022_20220216125238.jpg:
224   JPEG image data, JFIF standard 1.01, ...
225 @end example
226
227 @command{feeds-encs.zsh} does not parallelize jobs, because enclosure are
228 often heavy enough to satiate your Internet link. @command{wget}'s
229 progress is also printed both to stderr and @file{feeds/FEED/encs.log}.
230
231 Of course you can also download only single feed's enclosures:
232
233 @example
234 $ cmd/encs.zsh path/to/FEED [optional overriden destination directory]
235 @end example
236
237 @end table