Commit Graph

1014 Commits

Author SHA1 Message Date
Hiltjo Posthuma 03bc1ec04b sfeed_curses.1: clarify an exception with SIGINT
SIGTERM is the best way to quit the program, because SIGINT can cancel only the
line editor prompt when using it.
2022-01-19 19:54:16 +01:00
Hiltjo Posthuma 30d398b2fe sfeed_curses: consistency: mousereport: use off_t like the other functions 2022-01-19 19:46:27 +01:00
Hiltjo Posthuma fe0c6fa283 sfeed_curses: line editor: add more clear comments of signal handling 2022-01-19 19:46:05 +01:00
Hiltjo Posthuma 1742c5e687 sfeed: parsetime: allow leap second like 23:59:60
Specified in RFC2822 Section 3.3. Date and Time Specification

"[...] the time-of-day MUST be in the range 00:00:00 through 23:59:60 (the
number of seconds allowing for a leap second; see [STD12]) [...]"

To test:

	<entry><updated>2016-12-31T23:59:60Z</updated></entry>
2022-01-19 19:32:01 +01:00
Hiltjo Posthuma 87aafd5d45 util: strtotime: expand on comment about 2038-readiness
Also tested on MIPS32BE which has 32-bit time_t and which wraps the time value.
2022-01-14 18:35:44 +01:00
Hiltjo Posthuma 2101baf3bb util: parsetime(): fix comment, long long supports atleast 64-bit range 2022-01-14 13:10:58 +01:00
Hiltjo Posthuma 20686256db sfeed_curses: pedantic fix for UB with an empty URL file
When a new URL file is used with no URL entries then NULL is passed to qsort()
and bsearch(). This is reported by clang UBsan as undefined behaviour
(debatable), but no issue in practise with many implementations. Fix it anyway.

To reproduce with clang UBsan:
Compile with clang or gcc with CFLAGS and LDFLAGS -fsanitize=undefined
touch /tmp/urls # new file which should be empty.
SFEED_URL_FILE=/tmp/urls sfeed_curses 2>/tmp/log
^D
q
cat /tmp/log
2022-01-14 00:03:38 +01:00
Hiltjo Posthuma 790a941eb0 README: sfeed_download small changes 2022-01-06 13:18:52 +01:00
Hiltjo Posthuma 27a46121b3 README: small typo and rewording for sfeed_download example 2022-01-06 12:38:18 +01:00
Hiltjo Posthuma 63f9271555 README: add a listing of the formats supported 2022-01-06 12:31:03 +01:00
Hiltjo Posthuma f25a3e56e4 README: add sfeed_download example, parallel downloader/extractor 2022-01-06 12:30:45 +01:00
Hiltjo Posthuma e158bec623 sfeed_markread: set all locale variables and use LC_ALL 2022-01-04 18:20:54 +01:00
Hiltjo Posthuma 0c9f43581e Makefile: add comment for feature test macro on FreeBSD
Reported by Christos Margiolis and plasmoduck, thanks
2022-01-03 16:43:53 +01:00
Hiltjo Posthuma a046616853 Makefile: tiny typo: add space after SFEED_CURSES_CPPFLAGS 2022-01-03 16:36:50 +01:00
Hiltjo Posthuma d30a9301ee sfeed_content: allow to set HTML converter with env variable
This makes it a bit more easy to reuse the script and makes the run-time
dependency on lynx more optional.

For example with w3m:

	SFEED_HTMLCONV="w3m -I UTF-8 -O UTF-8 -T text/html -dump" \
		sfeed_curses ~/.sfeed/feeds/*

(of course this can be set in a wrapper script or shell profile too)
2021-12-24 11:45:34 +01:00
Hiltjo Posthuma 453ba1b6c1 sfeed_markread: small white-space fix 2021-12-23 18:30:55 +01:00
Hiltjo Posthuma 00dda4a201 README: improve newsboat export script
Performance improvements, use feed URL if the feed title is not (yet) set.
2021-12-23 18:30:19 +01:00
Hiltjo Posthuma 4e282a7dcb README: add GNU/Hurd
tested for fun
2021-12-23 18:29:51 +01:00
Hiltjo Posthuma 2f5bbf1939 sfeed_atom: add category field(s) 2021-12-23 18:29:26 +01:00
Hiltjo Posthuma 6131391e59 LICENSE: bump year 2021-12-23 18:29:01 +01:00
Hiltjo Posthuma 90dc98b732 bump version to 1.1 2021-11-27 11:26:59 +01:00
Hiltjo Posthuma 80a1ee3780 README: reword the part mentioning SFEED_THEME 2021-11-26 20:38:11 +01:00
Hiltjo Posthuma 94c2ea473a README: small rewording 2021-11-26 20:36:07 +01:00
Hiltjo Posthuma 70ec60e906 sfeed.1: add sfeed_curses example 2021-11-26 18:05:49 +01:00
Hiltjo Posthuma a0d3690aa6 Makefile: merge contents of sfeed_curses Makefile
sfeed_curses can be optionally compiled. Separate flags can be passed for
example for the curses library.

Also pass CFLAGS and LDFLAGS as a suffix.
See commit 0a9c4460c15e90113607ff1928858dfa940df725 of sfeed_curses
This is useful when passing -Wl,--as-needed or hardening flags.
2021-11-26 12:27:30 +01:00
Hiltjo Posthuma f2edcbb9d9 sfeed_curses: reuse some functions in util 2021-11-26 12:15:12 +01:00
Hiltjo Posthuma ac1ae80f3d README: merge the contents of the README of sfeed_curses 2021-11-26 12:12:40 +01:00
Hiltjo Posthuma 3cb7df56e0 import sfeed_curses
Import sfeed_curses into sfeed.
The files are based of the commit 8e151ce48b503ad0ff0e24cb1be3bc93d6fbd895
2021-11-26 12:10:05 +01:00
Hiltjo Posthuma 618a6561cd sfeed_mbox: escape the link and enclosure text when using HTML content
commit ed8079dc3e added an option
$SFEED_MBOX_CONTENT with a content-type text/html to include the content.
However in this context the link and enclosure were not fully escaped.
2021-11-24 21:52:47 +01:00
Hiltjo Posthuma 9670471dad sfeed.1: improve a comment for string_append 2021-11-23 16:41:47 +01:00
Hiltjo Posthuma 6f4dbe9119 sfeed.1: add a basic usage example for using the sfeed package
"man sfeed" now hopefully more quickly gives a better overview how the tools
work together. Reference the README for extended examples and use-cases.
2021-11-23 16:35:36 +01:00
Hiltjo Posthuma 71e9c93590 sfeed.{1,5}: small rewording improvement 2021-11-23 16:35:13 +01:00
Hiltjo Posthuma de0877aa06 sfeed.{1,5}: the first author is parsed
The Atom RFC standard supports multiple authors, but this is usually one.
The first author is parsed.
2021-11-23 16:34:13 +01:00
Hiltjo Posthuma 4d565772a6 code-style: define fieldmap in the same order as the enum declaration 2021-11-23 11:19:33 +01:00
Hiltjo Posthuma 50fbf152ed sfeed.{1,5}: small rewording for the '|' character 2021-10-25 23:03:32 +02:00
Hiltjo Posthuma 3718d50017 sfeed_mbox: add link as base URL for HTML content
This is useful for HTML viewers (like lynx -dump) in mail clients to use the
base href as the base URL for relative links in the HTML content.
2021-10-25 23:02:33 +02:00
Hiltjo Posthuma 6fb7a2d618 sfeed_mbox: use 64-bit for the checksum number
This makes the checksum number atleast 64-bit and makes the Message-ID header
consistent across mixed 32-bit and 64-bit systems.

Tested on amd64 and MIPS32BE.
2021-10-25 23:00:27 +02:00
Hiltjo Posthuma 34e4c3f859 README: tested with the compiler chibicc and RISCV64 VM (OpenBSD and Linux)
chibicc (amd64): https://github.com/rui314/chibicc
2021-10-24 12:00:37 +02:00
Hiltjo Posthuma cb4094f3f0 Makefile: consistency and pedantic change: use ar -rc instead of ar rc
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ar.html

This was changed in the below commit but should have been changed consistently:

commit 3d2cd7cf4a
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Wed Jun 10 14:40:06 2020 +0200

    Makefile: pedantic change: use ar -rc instead of ar rc
2021-10-05 12:07:00 +02:00
Hiltjo Posthuma 3efc39c8c7 bump version to 1.0 2021-08-06 18:35:08 +02:00
Hiltjo Posthuma 8efcf91b46 sfeed_opml_export: fix typo: opml -> OPML 2021-08-06 17:41:04 +02:00
Hiltjo Posthuma f2091c3464 sfeedrc.5: fix typos 2021-08-06 17:40:38 +02:00
Hiltjo Posthuma bf6d74e097 sfeed_mbox.1: add examples to this man page aswell 2021-08-04 10:30:26 +02:00
Hiltjo Posthuma 702fd51930 man page improvements 2021-08-03 20:43:54 +02:00
Hiltjo Posthuma 7199cd10a9 code-style: use a newline before return in main() 2021-08-03 20:43:54 +02:00
Hiltjo Posthuma 93044ecd31 man page improvements
- Some rewording and typo fixes.
- Specify in more detail how sfeed_web detects links from HTML code.
2021-07-25 11:46:44 +02:00
Hiltjo Posthuma 8a07c4a3d0 sfeed_{web,xmlenc}.1: use my site as an example 2021-07-24 22:46:05 +02:00
Hiltjo Posthuma ae4efcfe05 sfeed_update.1: just use ~/ instead of $HOME consistently in examples 2021-07-22 16:58:50 +02:00
Hiltjo Posthuma 7c78c67806 code-style: change gmtime to the reentrant/thread-safe gmtime_r
No functional or performance difference (intended) because these programs are
not threaded.
2021-07-19 12:50:44 +02:00
Hiltjo Posthuma 7086670e43 sfeed.c: parsetime: support short digit years for RSS pubDate fields (RFC822)
RSS (pubDate) uses RFC822 dates. This standard is obsoleted by RFC2822.

The RSS 2.0 spec says for the pubDate field:

"[...] All date-times in RSS conform to the Date and Time Specification of RFC
822, with the exception that the year may be expressed with two characters or
four characters (four preferred)."

RFC822 section 5.1 describes the syntax with 2 digit years:
https://datatracker.ietf.org/doc/html/rfc822#section-5.1

It was obsoleted/fixed in RFC2822 section 4.3:
https://datatracker.ietf.org/doc/html/rfc2822#section-4.3
"  Where a two or three digit year occurs in a date, the year is to be
   interpreted as follows: If a two digit year is encountered whose
   value is between 00 and 49, the year is interpreted by adding 2000,
   ending up with a value between 2000 and 2049.  If a two digit year is
   encountered with a value between 50 and 99, or any three digit year
   is encountered, the year is interpreted by adding 1900."

In the real world I've seen all sites using RSS use the 4-digit format.

For historic context of changes and what feeds it might affect:

- RFC822 was published in 13 august 1982, obsoleted by RFC2822.
- RFC2822 was published in april 2001, obsoleted by RFC5322.
- RFC5322 was published in october 2008.
- RDF was started around 1996. It was published around 2004.
- March 15, 1999: RSS 0.90 (Netscape), published by Netscape and authored by
  Ramanathan Guha.
- July 10, 1999: RSS 0.91 (Netscape), published by Netscape and authored by Dan
  Libby.
- June 9, 2000: RSS 0.91 (UserLand), published by UserLand Software and
  authored by Dave Winer.
- Dec. 25, 2000: RSS 0.92, UserLand.
- Aug. 19, 2002: RSS 2.0, UserLand.
- July 15, 2003: RSS 2.0 (version 2.0.1), published by the Berkman Center for
  Internet & Society at Harvard Law School and authored by Dave Winer.
- July 15, 2003: RSS 2.0 (version 2.0.1-rv-1), published by the RSS Advisory
  Board.
- July 17, 2003: RSS 2.0 (version 2.0.1-rv-2), RSS Advisory Board.
- April 6, 2004: RSS 2.0 (version 2.0.1-rv-3), RSS Advisory Board.
- May 31, 2004: RSS 2.0 (version 2.0.1-rv-4), RSS Advisory Board.
- June 19, 2004: RSS 2.0 (version 2.0.1-rv-5), RSS Advisory Board.
- January 25, 2005: RSS 2.0 (version 2.0.1-rv-6), RSS Advisory Board.
- Aug. 12, 2006: RSS 2.0 (version 2.0.8), RSS Advisory Board.
- June 5, 2007: RSS 2.0 (version 2.0.9), RSS Advisory Board.
- Oct. 15, 2007: RSS 2.0 (version 2.0.10), RSS Advisory Board.
- March 30, 2009 (current): RSS 2.0 (version 2.0.11), RSS Advisory Board.

RSS history source: https://www.rssboard.org/rss-history
2021-07-11 13:29:12 +02:00