From 275cc6c2d02d1d2782b4d13d9ef0889f3ee93876 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Tue, 29 Mar 2022 11:25:30 +0200 Subject: sfeed.1: add an example to convert to UTF-8 using iconv --- sfeed.1 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'sfeed.1') diff --git a/sfeed.1 b/sfeed.1 index 8075ca4..70354e3 100644 --- a/sfeed.1 +++ b/sfeed.1 @@ -1,4 +1,4 @@ -.Dd November 26, 2021 +.Dd March 29, 2022 .Dt SFEED 1 .Os .Sh NAME @@ -55,6 +55,15 @@ Item, categories, multiple values are separated by the '|' character. .Bd -literal curl -s 'https://codemadness.org/atom.xml' | sfeed .Ed +.Pp +To convert the character set from a feed that is not UTF-8 encoded the +.Xr iconv 1 +tool can be used: +.Bd -literal +curl -s 'https://codemadness.org/some_iso-8859-1_feed.xml' | \\ +iconv -f iso-8859-1 -t utf-8 | \\ +sfeed +.Ed .Sh EXAMPLE SETUP 1. Create a directory for the sfeedrc configuration and the feeds: .Bd -literal -- cgit v1.2.3 From 06cd065b6e4ee41d893caae5200bf276ae6a12bd Mon Sep 17 00:00:00 2001 From: Anders Damsgaard Date: Mon, 2 May 2022 14:46:25 +0200 Subject: manual pages: properly escape backslashes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From the mdoc(7) extended introduction[0]: >To output a backslash, use the escape sequence ā€˜\eā€™. Never use the >escape sequence ā€˜\\ā€™ in any context. 0: https://mandoc.bsd.lv/mdoc/intro/escaping.html --- sfeed.1 | 4 ++-- sfeed.5 | 4 ++-- sfeedrc.5 | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'sfeed.1') diff --git a/sfeed.1 b/sfeed.1 index 70354e3..34cd5fb 100644 --- a/sfeed.1 +++ b/sfeed.1 @@ -23,8 +23,8 @@ SPACE character. Control characters are removed. .Pp The content field can contain newlines and these are escaped. -TABs, newlines and '\\' are escaped with '\\', so it becomes: '\\t', '\\n' -and '\\\\'. +TABs, newlines and '\e' are escaped with '\e', so it becomes: '\et', '\en' +and '\e\e'. Other whitespace characters except spaces are removed. Control characters are removed. .Pp diff --git a/sfeed.5 b/sfeed.5 index cd422d0..8b2638e 100644 --- a/sfeed.5 +++ b/sfeed.5 @@ -17,8 +17,8 @@ SPACE character. Control characters are removed. .Pp The content field can contain newlines and these are escaped. -TABs, newlines and '\\' are escaped with '\\', so it becomes: '\\t', '\\n' -and '\\\\'. +TABs, newlines and '\e' are escaped with '\e', so it becomes: '\et', '\en' +and '\e\e'. Other whitespace characters except spaces are removed. Control characters are removed. .Pp diff --git a/sfeedrc.5 b/sfeedrc.5 index 95ffc04..10c234e 100644 --- a/sfeedrc.5 +++ b/sfeedrc.5 @@ -160,7 +160,7 @@ file: # fetch(name, url, feedfile) fetch() { # allow for 1 redirect, hide User-Agent, timeout is 15 seconds. - curl -L --max-redirs 1 -H "User-Agent:" -f -s -m 15 \\ + curl -L --max-redirs 1 -H "User-Agent:" -f -s -m 15 \e "$2" 2>/dev/null } .Ed -- cgit v1.2.3 From 796e311b746ef94f11efcf003e6b3c858597e447 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Mon, 2 May 2022 20:09:15 +0200 Subject: manual pages: properly escape some more backslashes ... and bump the date also. --- sfeed.1 | 6 +++--- sfeed.5 | 2 +- sfeed_gopher.1 | 4 ++-- sfeedrc.5 | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'sfeed.1') diff --git a/sfeed.1 b/sfeed.1 index 34cd5fb..c4a3c02 100644 --- a/sfeed.1 +++ b/sfeed.1 @@ -1,4 +1,4 @@ -.Dd March 29, 2022 +.Dd May 2, 2022 .Dt SFEED 1 .Os .Sh NAME @@ -60,8 +60,8 @@ To convert the character set from a feed that is not UTF-8 encoded the .Xr iconv 1 tool can be used: .Bd -literal -curl -s 'https://codemadness.org/some_iso-8859-1_feed.xml' | \\ -iconv -f iso-8859-1 -t utf-8 | \\ +curl -s 'https://codemadness.org/some_iso-8859-1_feed.xml' | \e +iconv -f iso-8859-1 -t utf-8 | \e sfeed .Ed .Sh EXAMPLE SETUP diff --git a/sfeed.5 b/sfeed.5 index 8b2638e..be55c18 100644 --- a/sfeed.5 +++ b/sfeed.5 @@ -1,4 +1,4 @@ -.Dd November 23, 2021 +.Dd May 2, 2022 .Dt SFEED 5 .Os .Sh NAME diff --git a/sfeed_gopher.1 b/sfeed_gopher.1 index a5b4e3a..671cd08 100644 --- a/sfeed_gopher.1 +++ b/sfeed_gopher.1 @@ -1,4 +1,4 @@ -.Dd July 31, 2021 +.Dd May 2, 2022 .Dt SFEED_GOPHER 1 .Os .Sh NAME @@ -50,7 +50,7 @@ The default is "70". .Ex -std .Sh EXAMPLES .Bd -literal -SFEED_GOPHER_HOST="codemadness.org" SFEED_GOPHER_PATH="/feeds/" \\ +SFEED_GOPHER_HOST="codemadness.org" SFEED_GOPHER_PATH="/feeds/" \e sfeed_gopher ~/.sfeed/feeds/* .Ed .Sh SEE ALSO diff --git a/sfeedrc.5 b/sfeedrc.5 index 10c234e..344ee42 100644 --- a/sfeedrc.5 +++ b/sfeedrc.5 @@ -1,4 +1,4 @@ -.Dd March 7, 2022 +.Dd May 2, 2022 .Dt SFEEDRC 5 .Os .Sh NAME -- cgit v1.2.3 From 6a762a1d62df6d6fe8e2fbd1e28cf9ee8d9a8103 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Sat, 7 Jan 2023 12:08:14 +0100 Subject: sfeed.1: reference sfeed_opml_import It is used in the examples. (Do not directly reference iconv to keep some kind of clear reference list) --- sfeed.1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sfeed.1') diff --git a/sfeed.1 b/sfeed.1 index c4a3c02..79d43be 100644 --- a/sfeed.1 +++ b/sfeed.1 @@ -1,4 +1,4 @@ -.Dd May 2, 2022 +.Dd January 7, 2023 .Dt SFEED 1 .Os .Sh NAME @@ -103,6 +103,7 @@ There are also other formatting programs included. The README file has more examples. .Sh SEE ALSO .Xr sfeed_curses 1 , +.Xr sfeed_opml_import 1 , .Xr sfeed_plain 1 , .Xr sfeed_update 1 , .Xr sfeed 5 , -- cgit v1.2.3 From 5027669efb6a969afa2c8adcf7c2322dcf75de1f Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Mon, 15 May 2023 18:48:56 +0200 Subject: fix typo --- sfeed.1 | 4 ++-- sfeed.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'sfeed.1') diff --git a/sfeed.1 b/sfeed.1 index 79d43be..5c348a8 100644 --- a/sfeed.1 +++ b/sfeed.1 @@ -111,5 +111,5 @@ The README file has more examples. .Sh AUTHORS .An Hiltjo Posthuma Aq Mt hiltjo@codemadness.org .Sh CAVEATS -If a timezone for the timestamp field is not in the RFC822 or RFC3339 format it -is not supported and the timezone is interpreted as UTC+0. +If a timezone for the timestamp field is not in the RFC 822 or RFC 3339 format +it is not supported and the timezone is interpreted as UTC+0. diff --git a/sfeed.c b/sfeed.c index e7ffa05..888a575 100644 --- a/sfeed.c +++ b/sfeed.c @@ -504,10 +504,10 @@ datetounix(long long year, int mon, int day, int hour, int min, int sec) } /* Get timezone from string, return time offset in seconds from UTC. - * NOTE: only parses timezones in RFC-822, many other timezone names are + * NOTE: only parses timezones in RFC 822, many other timezone names are * ambiguous anyway. - * ANSI and military zones are defined wrong in RFC822 and are unsupported, - * see note on RFC2822 4.3 page 32. */ + * ANSI and military zones are defined wrong in RFC 822 and are unsupported, + * see note on RFC 2822 4.3 page 32. */ static long gettzoffset(const char *s) { @@ -627,7 +627,7 @@ parsetime(const char *s, long long *tp) ; for (v = 0, i = 0; i < 4 && ISDIGIT((unsigned char)*s); s++, i++) v = (v * 10) + (*s - '0'); - /* obsolete short year: RFC2822 4.3 */ + /* obsolete short year: RFC 2822 4.3 */ if (i == 2 || i == 3) v += (i == 2 && v >= 0 && v <= 49) ? 2000 : 1900; va[0] = v; /* year */ -- cgit v1.2.3