]> Sergey Matveev's repositories - feeder.git/blobdiff - doc/usage.texi
Various refactoring and parametrizing
[feeder.git] / doc / usage.texi
index c99e5a8e1f306c2b9ffc5c61699cf891d3a6ed60..328201a42f8cd1f0b2b23751d84a240d03bedbc6 100644 (file)
@@ -28,7 +28,7 @@ $ echo http://example.com/feed.atom > feeds/my_first_feed/url
 @end example
 
 or convert Newsboat @file{urls} file (containing many lines with URLs)
-with @file{urls2feeds.zsh} to subdirectories hierarchy:
+with @command{urls2feeds.zsh} to subdirectories hierarchy:
 
 @example
 $ ./urls2feeds.zsh < ~/.newsboat/urls
@@ -36,56 +36,73 @@ $ cat feeds/blog.stargrave.org_russian_feed.atom/url
 http://blog.stargrave.org/russian/feed.atom
 @end example
 
-@item Download your feed(s) data
+@command{urls2feeds.zsh} won't touch already existing directories and will
+warn if some of them disappeared from @file{urls}.
+
+@item Check configuration options
 
-Downloading is implemented in @command{redo}'s
-@file{default.download.do} file. Probably you want to change its default
-@env{$PROXY} value. It uses @command{curl}, that is aware of
-@code{If-Modified-Since} and @code{ETag} headers, compressed content
-encodings and HTTP redirections.
+@file{cmd/env.rc} contains list of various options you can override by
+environment variables, like @command{curl}, @command{wget},
+@command{zstd}, @command{parallel} command invocations,
+@code{User-Agent}, number of download/parse jobs run in parallel and so on.
 
-You can invoke feed downloading like that:
+@item Download your feed(s) data
 
 @example
-$ redo feeds/blog.stargrave.org_russian_feed.atom/feed.download
+$ cmd/download.sh feeds/blog.stargrave.org_russian_feed.atom
+$ ./feeds-download.zsh # to invoke parallel downloading of everything
 @end example
 
+Probably you want to change its default @env{$PROXY} value. It uses
+@command{curl}, that is aware of @code{If-Modified-Since} and
+@code{ETag} headers, compressed content encodings and HTTP redirections.
 If you want to see verbose output, then set @env{FEEDER_CURL_VERBOSE=1}.
 
-As a rule, you wish to run all feeds downloading in parallel. You can
-use @file{feeds-download.zsh}, that just invokes @command{redo-ifchange}
-with @option{-f} option (forceful rebuild). Why that? Because most
-@command{redo} implementations (that forces target building) do not
-parallelize specified targets build. But you can also use @command{parallel}:
+@item Parse your feeds
 
 @example
-$ parallel "redo @{@}/feed.download" ::: feeds/*
+$ cmd/parse.sh feeds/blog.stargrave.org_russian_feed.atom
+$ ./feeds-parse.zsh # to parse all feeds in parallel
 @end example
 
-@item Parse your feeds
+@item Download-n-parse
 
-Parsing (and Maildir filling) is implemented in @command{redo}'s
-@file{default.parse.do} file. It calls @command{cmd/feed2mdir/feed2mdir}
-utility, that read @file{feeds/FEED/feed} from stdin, takes Maildir
-directory as its first argument and prints feed's title.
+You can also download and parse the feeds immediately:
 
-You can use @file{feeds-parse.zsh} helper or invoke @command{parallel}
-as in example above, replacing @code{.download} with @code{.parse}.
+@example
+$ ./feeds-dnp.zsh
+@end example
+
+@item Quick overview of the news:
 
 @example
-$ ./feeds-parse.zsh
+$ ./feeds-news.zsh
+habr.com_ru_rss_interesting: 7
+habr.com_ru_rss_news: 3
+lobste.rs_rss: 3
+naked-science.ru_?yandex_feed=news: 1
+planet.fsfe.org_atom.xml: 1
+www.astronews.ru_astronews.xml: 1
+www.darkside.ru_news_rss: 5
 @end example
 
 @item Run Mutt
 
 @example
-$ ./feeds-browse.zsh
+$ ./feeds-browse.sh
 @end example
 
 That will read all feeds titles and create @file{mutt.rc} sourceable
 configuration file with predefined helpers and @code{mailboxes}
-commands. Mutt will be started in mailboxes browser mode (I will skip
-many entries):
+commands.
+
+That configuration contains @code{auto_view text/html}, that expects
+proper @file{mailcap} configuration file with @code{text/html} entry to
+exists. Mutt has some built-in default search paths for, but you can
+override them with @env{$MAILCAPS} environment variable. There is
+example @file{contrib/mailcap}.
+
+Mutt will be started in mailboxes browser mode (I will skip many entries):
 
 @verbatim
   1   N [  1|101] 2021-02-17 20:41 Cryptology ePrint Archive/
@@ -120,6 +137,12 @@ And again this is made for convenience. It will mark both new
 (@strong{N}) and old-but-unread (@strong{O}) messages as read. You will
 see left tag-marks near each message to understand what was touched.
 
+@item Press @code{o} to open links and enclosures URLs
+
+Do it in pager mode and you message will be piped to
+@command{cmd/x-urlview.sh}, that will show all @code{X-URL}
+and @code{X-Enclosure} links.
+
 @item Index your messages
 
 @example
@@ -156,21 +179,59 @@ message flags display and adding name of the feed in parenthesis.
 
 @item Cleanup excess number of messages
 
+By default (@env{$FEEDER_MAX_ITEMS}) only 100 entries are processed.
+Parser only appends them, but does not remove obsolete ones.
+
 @example
 $ ./feeds-clear.zsh
+$ cmd/clear.zsh feeds/FEED # to clear single feed
 @end example
 
-That will remove all messages in all feeds @file{cur/} directory that is
-not first hundred of ones, ordered by @code{mtime}. Pay attention that
-@file{new/} directory is not touched, so you won't loose completely new
-and unread messages when you are on vacation and left @command{cron}-ed
-workers. @command{cmd/feed2mdir/feed2mdir} command by default has
-@option{-max-entries 100} option set.
+will clear everything exceeding the quantity limit. You can set that
+limit on per-feed basis. For example @code{echo 50 > feed/FEED/max}.
+0 means no limit and keep all the messages.
+
+Pay attention that @file{new/} directory is not touched, so you won't
+loose completely new and unread messages when you are on vacation and
+left @command{cron}-ed workers.
 
 @item If you want to clean download state
 
 @example
-$ redo feeds/FEED/feed.clean
+$ cmd/download-clean.sh feed/FEED
+@end example
+
+@anchor{Enclosures}
+@item Download enclosures
+
+Many feeds include links to so-called enclosures, like audio files for
+podcasts. While you mail is not processed by MUA, its @file{new/}
+messages still there, you can run enclosure downloading process, that
+uses @url{https://www.gnu.org/software/wget/, GNU Wget}. Each
+enclosure's filename is more or less filesystem-friendly with the
+current timestamp in it.
+
+@example
+$ ./feeds-encs.zsh
+[...]
+monsterfeet.com_grue.rss/encs/20220218-152822-traffic.libsyn.com_monsterfeet_grue_018.mp3
+www.astronews.ru_astronews.xml/encs/20220219-115710-www.astronews.ru_news_2022_20220216125238.jpg
+[...]
+$ file feeds/**/encs/*/
+monsterfeet.com_grue.rss/encs/20220218-152822-traffic.libsyn.com_monsterfeet_grue_018.mp3:
+  Audio file with ID3 version 2.2.0, contains:MPEG ADTS, layer III, v1,  96 kbps, 44.1 kHz, Monaural
+www.astronews.ru_astronews.xml/encs/20220219-115710-www.astronews.ru_news_2022_20220216125238.jpg:
+  JPEG image data, JFIF standard 1.01, ...
+@end example
+
+@command{feeds-encs.zsh} does not parallelize jobs, because enclosure are
+often heavy enough to satiate your Internet link. @command{wget}'s
+progress is also printed both to stderr and @file{feeds/FEED/encs.log}.
+
+Of course you can also download only single feed's enclosures:
+
+@example
+$ cmd/encs.zsh path/to/FEED [optional overriden destination directory]
 @end example
 
 @end table