Age | Commit message (Collapse) | Author |
|
By introducing the new environment variable $SFEED_NEW_MAX_SECS in all
sfeed_* utilities marking feeds as new based on comparing their age, it
is now possible to override this age limit.
This allows, for example, to be notified about new feeds within the last
hour with
SFEED_NEW_MAX_SECS=3600 sfeed_plain ~/.sfeed/feeds/*
while creating a beautiful web report for last week's news by
SFEED_NEW_MAX_SECS=604800 sfeed_html ~/.sfeed/feeds/*
|
|
|
|
This outputs the TSV data to JSON.
It uses a subset of JSON Feed 1.1:
https://www.jsonfeed.org/version/1.1/
|
|
This is an active maintained fork.
|
|
Similar to the recent fix for sfeed_update in commit
5a27c58675ddf4113d64a84f715cb3fecb681a6d
|
|
https://www.jsonfeed.org/version/1.1/
|
|
Tested sfeed, sfeed_plain and sfeed_html for now.
There are minor changes required for sfeed and some additional compatibility
function changes required to make the format tools compile.
Rough list of changes required:
- xml.c: rename getchar_unlocked -> getchar
- sfeed.c: EOVERFLOW -> ENOMEM
- wcwidth: just filter ASCII range < 32 = -1 and > 127 = 0, rest = 1.
- getline
- localtime_r -> just do a localtime + memcpy.
Make sure to increase stack size when compiling:
owcc -k32768 -Os -s -o sfeed.exe sfeed.c util.c xml.c
Resulting .exe binary is 27KB, 17KB compressed with UPX.
The HTML output looks fine in Netscape Navigator and Internet Explorer 3 :)
|
|
... and some small rewording.
|
|
|
|
|
|
|
|
found via codespell
$ codespell --ignore-regex Nd
|
|
|
|
This should not use the plain-text URL file ($SFEED_URL_FILE).
|
|
It would mess up the output since the progress bar writes to stderr aswell.
|
|
|
|
|
|
Change the example to reload the feeds anyway, even if one of the feeds
(temporarily) failed to update.
|
|
separator
echo is unportable in this way and names containing characters like an option
(-n) or backslash or escape codes (\e, \n, etc) could be messy.
For awk set LC_ALL=C for simple collation.
This makes sfeed_opml_export slower in some shells that don't have printf
builtin though. For example with about 150 feeds in a config file it is a bit
slower on OpenBSD ksh.
time ./sfeed_opml_export | wc -l
152
0m00.29s real 0m00.05s user 0m00.20s system
time sfeed_opml_export | wc -l
152
0m00.02s real 0m00.00s user 0m00.03s system
|
|
|
|
- Return exit code, which makes xargs return 123 when any of the downloads
failed.
- Write errors to stderr.
- Write non-errors to stdout.
|
|
Set exit status non-zero if any of the feeds failed similar to what
sfeed_update also does now.
|
|
Tested with the scc compiler which is a pure c99 compiler.
sys/types.h is not needed here anymore (it was used for ssize_t).
Side-note: scc can now compile the sfeed parser program!
It requires these changes at the time of writing: Add a strcasecmp and
strncasecmp function and use getchar instead of getchar_unlocked.
|
|
|
|
Maybe this is out-of-scope for the sfeed documentation though.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Performance improvements, use feed URL if the feed title is not (yet) set.
|
|
tested for fun
|
|
|
|
|
|
|
|
chibicc (amd64): https://github.com/rui314/chibicc
|
|
This works on sfeed(5) feed output since they are already sorted.
|
|
|
|
The "\s" escape sequence is non-POSIX and GNU awk gives a warning:
gawk: cmd. line:69: warning: escape sequence `\s' treated as plain `s'
BSD awk does not give this warning and supports it.
Use the POSIX [[:space:]] character class instead.
References:
- https://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html
The table in the section "Regular Expressions".
- https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap05.html#tag_05
|
|
These are BSD functions.
- HaikuOS now compiles without having to use libbsd.
- Tested on SerenityOS (for fun), which doesn't have these functions (yet).
With a small change to support wcwidth() sfeed works on SerenityOS.
|
|
Since newsboat version 2.22 (2020-12-21) it stores the content mime-type of a
field so allow to export this.
The older entries are empty and will be exported as "html" (even though they
might have been plain-text).
... also add the (empty) category field.
|
|
Workaround it by setting the empty "middle" fields to some value. The last
field can be empty.
Some feeds were incorrectly using the wrong base URL if the `baseurl` field was
empty but the encoding field was set. So it incorrectly used the encoding field
instead.
Only now noticed some feeds were failing because the baseURL is validated since
commit f305b032bc19b4e81c0dd6c0398370028ea910ca and returning a non-zero exit
status.
This doesn't happen with GNU xargs, busybox or toybox xargs.
Affected (atleast): OpenBSD, NetBSD, FreeBSD and DragonFlyBSD xargs which share
similar code.
Simple way to reproduce the difference:
printf 'a\0\0c\0' | xargs -0 echo
Prints "a c" on *BSD.
Prints "a c" on GNU xargs (and some other implementations).
|
|
Combine E-Tags, If-Modified-Since in one section. Also mention the curl
--compression option for typically GZIP decompression.
Note that E-Tags were broken in curl <7.73 due to a bug with "weak" e-tags.
https://github.com/curl/curl/issues/5610
From a question/feedback by e-mail from Hadrien Lacour, thanks.
|
|
|
|
Kindof a non-issue but if theres a sfeedrc with no feeds then xargs will still
be executed and give an error. The xargs -r option (GNU extension) fixes this:
From the OpenBSD xargs(1) man page:
"-r Do not run the command if there are no arguments. Normally the
command is executed at least once even if there are no arguments."
Reproducable with the sfeedrc:
feeds() {
true
}
|
|
|
|
This code uses the non-portable xargs -P option to more efficiently process
feeds in parallel.
|
|
Interesting C compiler project:
lacc: A simple, self-hosting C compiler:
https://github.com/larmel/lacc
|
|
- Export read/unread state to a separate plain-text "urls" file, line by line.
- Handle white-space control-chars better.
From the sfeed(1) man page:
" The fields: title, id, author are not allowed to have newlines and TABs,
all whitespace characters are replaced by a single space character.
Control characters are removed."
So do the reverse for newsboat aswell: change white-space characters which are
also control-characters (such as TABs and newlines) to a single space
character.
|