summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-08-09Merge remote-tracking branch 'upstream/master'HEADmasterBenjamin Chausse
2024-07-04sfeed.c: separator T could be lowercaseHiltjo Posthuma
From RFC3339: 5.6. Internet Date/Time Format " [...] NOTE: Per [ABNF] and ISO8601, the "T" and "Z" characters in this syntax may alternatively be lower case "t" or "z" respectively. This date/time format may be used in some environments or contexts that distinguish between the upper- and lower-case letters 'A'-'Z' and 'a'-'z' (e.g. XML). Specifications that use this format in such environments MAY further limit the date/time syntax so that the letters 'T' and 'Z' used in the date/time syntax must always be upper case. Applications that generate this format SHOULD use upper case letters. " Reference: https://www.rfc-editor.org/rfc/rfc3339
2024-06-30improve parsing whitespace after end tag namesHiltjo Posthuma
Simplified test-case: https://git.codemadness.org/sfeed_tests/commit/e091160c3125322193bd8f27691c87eaa48cfc93.html
2023-12-29bump version to 2.0Hiltjo Posthuma
2023-12-29sfeed_update: reword some commentsHiltjo Posthuma
2023-12-29sfeed_gopher: fix a clang-analyzer warningHiltjo Posthuma
When reading from stdin the fields `total` and `totalnew` structure of feed are incremented. However this value was uninitialized. For stdin the result was not read and unused anyway though.
2023-12-29sfeed_update: code-style and consistency: add some comments for functionsHiltjo Posthuma
2023-12-29sfeed_update/sfeed_opml_export: only allow regular filesHiltjo Posthuma
Be more strict and only allow regular files. It makes no sense to use device files or fifos with sfeed_update and it can cause issues, because sfeed_update expects to read the config file for each (child) invocation also.
2023-12-28sfeed_opml_export: disallow using a directory as a config fileHiltjo Posthuma
Same as the commit 9754fe74f7b5c0600cc41eef8c6f5c8305a74a18 for sfeed_update Tested on NetBSD 5.1: evaluating directories as config files could allow garbage, so disallow it. Devices / fifo, etc are still allowed.
2023-12-27sfeed_update: rename local variables just in caseHiltjo Posthuma
The config is loaded for each child program. These could override these variables if the user specifies the same name.
2023-12-27sfeed_update: remove xargs -sHiltjo Posthuma
Theres no need to specify. POSIX defines it should support at least LINE_MAX (2048 typically). OpenIndiana xargs doesn't conform to POSIX. It doesn't use the largest constraint but errors out. From POSIX: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/xargs.html "Values of size up to at least {LINE_MAX} bytes shall be supported, provided that the constraints specified in the DESCRIPTION are met. It shall not be considered an error if a value larger than that supported by the implementation or exceeding the constraints specified in the DESCRIPTION is given; xargs shall use the largest value it supports within the constraints."
2023-12-27sfeed_update: suppress output to stderr, like merge() already doesHiltjo Posthuma
Noticed while testing TMPDIR=/noaccess sort on Illumos/OpenIndiana, which gives a warning to stderr. For sort temporary directories might be used for large output.
2023-12-26LICENSE: bump yearHiltjo Posthuma
2023-12-26sfeedrc: bump default maxjobs from 8 to 16Hiltjo Posthuma
2023-12-26README: update dependency information for xargs for sfeed_updateHiltjo Posthuma
Remove the parallel xargs example because it is now the default.
2023-12-26sfeed_update: use xargs -P -0Hiltjo Posthuma
Some of the options, like -P are as of writing (2023) non-POSIX: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/xargs.html. However many systems support this useful extension for many years now. Some historic context: The xargs -0 option was added on 1996-06-11, about a year after the NetBSD import (over 27 years ago at the time of writing): http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/xargs/xargs.c?rev=1.2&content-type=text/x-cvsweb-markup On OpenBSD the xargs -P option was added on 2003-12-06 by syncing the FreeBSD code: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/xargs/xargs.c?rev=1.14&content-type=text/x-cvsweb-markup Looking at the imported git history log of GNU findutils (which has xargs), the very first commit already had the -0 and -P option on Sun Feb 4 20:35:16 1996 +0000. Tested on many systems, old and new, some notable: - OpenBSD 7.4 - Void Linux - FreeBSD 12 - NetBSD 9.3 - HaikuOS (uses GNU tools). - Slackware 11 - OpenBSD 3.8 - NetBSD 5.1 Some shells: - oksh - bash - dash - zsh During testing there are some incompatibilities found in parsing the fields so the arguments are passed as one argument which is split later on by the child program.
2023-12-26sfeed_update: mktemp: improve compatibility with older systemsHiltjo Posthuma
Tested on NetBSD 5.1: - mktemp -p doesn't exist there yet. - mktemp without any arguments/template doesnt work - mktemp -d without any arguments/template doesnt work
2023-12-26sfeed_update: disallow using a directory as a config fileHiltjo Posthuma
Tested on NetBSD 5.1: evaluating directories as config files could allow garbage, so disallow it. Devices / fifo, etc are still allowed.
2023-12-15README: sfeed_opml_export uses awkHiltjo Posthuma
2023-12-15sfeed_update: add die() function for exit and cleanup, respect $TMPDIRHiltjo Posthuma
- Add a die() helper function to cleanup and exit. - NOTE that with an empty sfeedtmpdir the case rm -rf "" is fine. - Respect $TMPDIR for creating temporary files like many UNIX tools do. - Fix: when creating "${sfeedtmpdir}/ok" fails for some reason cleanup the whole temporary directory as well. - Fix: when the feeds() function is not defined exit with status code 1 (this was incorrectly status code 0). Reproduce: sfeed_update /dev/null; echo $?
2023-12-09improve compatibility with zsh as a non-interactive shellHiltjo Posthuma
In zsh the variables $path and $status are special. https://zsh.sourceforge.io/Doc/Release/Parameters.html#index-path https://zsh.sourceforge.io/Doc/Release/Parameters.html#index-status (No promises I will keep up with this insanity in the future though)
2023-11-30sfeed_json: fix name of url field for attachmentsHiltjo Posthuma
This was a typo: "url:" should be "url".
2023-09-22sfeed_curses: mark functions as staticNRK
no reason for them not to be `static` and this also silences -Wmissing-prototypes warning (note: most of this patch was done by a sed(1) command.)
2023-09-22sfeed_gopher: mark function as staticNRK
2023-08-18bump version to 1.9Hiltjo Posthuma
2023-08-15improve wording and small typosHiltjo Posthuma
2023-08-09Makefile: change -lcurses to -lncurses for Gentoo in the commentHiltjo Posthuma
Reported by commodorian, thanks!
2023-08-01sfeed_update.1: remove mentioning of / in path names hereHiltjo Posthuma
This is documented in the sfeedrc.5 also where it is more suitable.
2023-08-01sfeed_curses.1: fix 2 typosHiltjo Posthuma
2023-08-01sfeed_json.1: make the formatting consistent with other similar man pagesHiltjo Posthuma
Such as sfeed_atom.1 or sfeed_twtxt.1
2023-07-31fix typo: current -> currentlyHiltjo Posthuma
Reported by Allan Wind, thanks!
2023-07-07sfeed_markread: fail early if creating a temporary file failedHiltjo Posthuma
2023-07-07sfeedrc.5: document each feed name should be uniqueHiltjo Posthuma
Asked via e-mail. This confused a person which converted an OPML file which yielded an sfeedrc with duplicate names or multiple "unnamed" entries. This caused sfeed_update to fail, because it tried to merge files with the same name and causing a race-condition because the temporary file with the same name was already moved.
2023-07-07sfeed_curses: move one line down when marking an item as read or unreadHiltjo Posthuma
I don't mind either behaviour, but it has been suggested by a few people. For example the mutt mail client also has this behaviour.
2023-07-02sfeedrc.5: remove branding (shaken, not stirred)Hiltjo Posthuma
2023-06-09sfeedrc.5: improve example by setting a different User-AgentHiltjo Posthuma
This is useful for sites that block clients that don't have a User-Agent header set.
2023-06-09README: improve note about CDNs and user-agent blockingHiltjo Posthuma
Prompted by a question from a user. Specificly mention reddit.com now blocks clients which don't set the User-Agent header. It is specificly mentioned because there is a reddit feed in the example sfeedrc.
2023-06-09add comment to reference to the man pages and README fileHiltjo Posthuma
These file contain examples and more details and may be overlooked/forgotten.
2023-06-09sfeed_update/sfeedrc: add url as parameter to the filter() and order() functionHiltjo Posthuma
This might make it easier to set filters or ordering by pattern matching on a group of feeds by the feed URL. For example youtube or reddit feeds. Another way which was already possible is prefixing names with for example: "reddit somename" or "yt somename".
2023-05-16improve to use proper includesHiltjo Posthuma
Reduce using some of the unneeded sys/* headers too. This makes it slightly more portable or easier to port also.
2023-05-16README: RSS 0.90+ is supported, not 0.91+Hiltjo Posthuma
See also: https://www.rssboard.org/rss-0-9-0
2023-05-15sfeed_atom: gmtime_r make it consistent with sfeed_mboxHiltjo Posthuma
When gmtime_r is called to get the current time show the same error message as sfeed_mbox does.
2023-05-15fix typoHiltjo Posthuma
2023-05-14sfeed_gopher: reduce scope and shadowing a variableHiltjo Posthuma
2023-05-14sfeed_curses.c: make struct urls static like the other variablesHiltjo Posthuma
2023-05-14xml.h: _XML_H_: macro name with an underscore is a reserved identifierHiltjo Posthuma
Found with clang -Wreserved-macro-identifier See also: https://wiki.sei.cmu.edu/confluence/display/c/DCL37-C.+Do+not+declare+or+define+a+reserved+identifier
2023-05-07iterate on previous commit which adds $SFEED_NEW_MAX_SECSHiltjo Posthuma
Separate the common pattern to get the time to compare new items in format tools to the new util function: getcomparetime(). Some changes and notes: - Change it so it is OK to set this value to 0 or negative (in the future). - sfeed_curses: truncating newmaxsecs to an int would limit the value too much. - Just use strtotime() and parse the value to time_t. This is a signed long (32-bit, until 2038) or signed long long (64-bit) on most platforms. - sfeed_curses gets the comparison time on reload aswell and it needs errno = 0, because it uses die(). time() is not guaranteed to set an errno if it fails. - Rename environment variable to $SFEED_NEW_AGE.
2023-05-07sfeed: datetounix: code-style, change , to separate lines (-Wcomma)Hiltjo Posthuma
2023-05-07sfeed_{curses,frames,gopher,html,plain}: SFEED_NEW_MAX_SECSAlvar Penning
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/*
2023-04-23bump version to 1.8Hiltjo Posthuma