flnews_post_proc 1.7 → 1.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +28 -35
- data/bin/flnews_post_proc +12 -56
- data/doc/html/flnews_post_proc.html +364 -52
- data/doc/{fr/html/flnews_post_proc.html → html/flnews_post_proc_fr.html} +19 -22
- data/doc/man/flnews_post_proc.1.gz +0 -0
- data/doc/man/flnews_post_proc_fr.1.gz +0 -0
- data/doc/pdf/flnews_post_proc.pdf +0 -0
- data/doc/pdf/flnews_post_proc_fr.pdf +0 -0
- data/doc/rst/flnews_post_proc.rst +26 -28
- data/doc/{fr/rst/flnews_post_proc.rst → rst/flnews_post_proc_fr.rst} +18 -21
- data/lib/basic_logging.rb +8 -40
- data/lib/body.rb +35 -129
- data/lib/configuration.rb +8 -15
- data/lib/flnews_post_proc.conf +6 -7
- data/lib/flnews_post_proc.rb +4 -5
- data/lib/headers.rb +13 -37
- data/lib/newsgroups.rb +17 -35
- data/lib/override.rb +2 -2
- data/lib/ruby_dlg +83 -86
- data/lib/version.rb +2 -3
- data/lib/whiptail_dlg +2 -7
- data/lib/yad_dlg +11 -12
- data/lib/zenity_dlg +7 -8
- metadata +9 -30
- data/doc/fr/man/flnews_post_proc.1.gz +0 -0
- data/doc/fr/pdf/flnews_post_proc.pdf +0 -0
- data/lib/_quoting_style_regexp +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f76e4432bd460f49ef15abd469ac4f79e1c4887c99229620b0a79ec9cb8ad836
|
4
|
+
data.tar.gz: a6416c6b5f53bdfb9995e1b64accadf97a18fbb2b2dc69b36f4aff86e38f35e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f331c0092c7ffeb7ac6b8ee485de68a8ad30534166b65b6be049d6b1d16a3a0a7754396da615dc397a6dd17ffdbf555363e4d41576a604963d09b21c4834031
|
7
|
+
data.tar.gz: 057cf2f67069ac2708d8b2444a6339b4671415bd55e86662f23d2ced0d95e5a7e80b69c3514123dab71a1edceab3717f346de7c876119c7c68bb6f31179dc3bb
|
data/README.md
CHANGED
@@ -7,12 +7,12 @@
|
|
7
7
|
Please give priority to the documentation which is delivered with the gem
|
8
8
|
file, as the markdown syntax plays tricks, sometimes, and I may not be
|
9
9
|
quick enough to correct this file. This applies especially to the section
|
10
|
-
[_Configuration_](#CONFIGURATION), below.
|
10
|
+
[_Configuration_](#CONFIGURATION), below.
|
11
11
|
|
12
|
-
The gem-file contains different formats of the man-page in English and French.
|
13
|
-
See section [_Source Code_](Source-Code), below, for instructions to access
|
14
|
-
these texts. Or see the same files [on the
|
15
|
-
Web](https://www.uplawski.eu/div/flnews/).
|
12
|
+
The gem-file contains different formats of the man-page in English and French.
|
13
|
+
See section [_Source Code_](Source-Code), below, for instructions to access
|
14
|
+
these texts. Or see the same files [on the
|
15
|
+
Web](https://www.uplawski.eu/div/flnews/).
|
16
16
|
|
17
17
|
SYNOPSIS
|
18
18
|
=======================
|
@@ -56,7 +56,7 @@ The flnews newsreader is sufficient for Usenet access, i.e. to receive and read
|
|
56
56
|
articles from -, as well as to write and post articles to newsgroups.
|
57
57
|
|
58
58
|
When you compare news-clients, you will always notice the differences and
|
59
|
-
choose the software that you prefer.
|
59
|
+
choose the software that you prefer. Flnews however, has the charm that you can
|
60
60
|
influence how the program itself works but also modify posts that flnews
|
61
61
|
produces, just before the program will transmit them to the chosen nntp-server.
|
62
62
|
|
@@ -83,8 +83,7 @@ some users may not always agree with the result and for arbitrary reasons:
|
|
83
83
|
would like to replace it against another, based on the newsgroup you are
|
84
84
|
about to post to.
|
85
85
|
The post-processor program sets specific signatures as configured for one
|
86
|
-
or several newsgroups.
|
87
|
-
the program pick one from the list.
|
86
|
+
or several newsgroups.
|
88
87
|
|
89
88
|
* Some custom headers may serve to convey additional information to
|
90
89
|
interested readers of your post, like GnuPG key IDs, your language skills
|
@@ -94,14 +93,14 @@ some users may not always agree with the result and for arbitrary reasons:
|
|
94
93
|
Custom headers may be defined in the configuration file for the program
|
95
94
|
and will then be added to each outgoing post.
|
96
95
|
|
97
|
-
* The
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
96
|
+
* The X-No-Archive header is sometimes set to avoid that an article be
|
97
|
+
saved and stays available to search-engines (Google, notably). Test-
|
98
|
+
postings, for example, do probably not justify at all that they would be
|
99
|
+
referenced in search results.
|
100
|
+
The post-processor program can impose the X-No-Archive header for all
|
101
|
+
posts to certain newsgroups.
|
102
102
|
|
103
|
-
**ATTN** As of 2024,
|
104
|
-
and it is the decision of server operators to honor it or not.
|
103
|
+
**ATTN** As of 2024, this header might serve no purpose any more.
|
105
104
|
|
106
105
|
* If a news post contains many references to either other posts or Web
|
107
106
|
pages, the text can be cluttered with URLs.
|
@@ -116,8 +115,8 @@ some users may not always agree with the result and for arbitrary reasons:
|
|
116
115
|
|
117
116
|
* The program can attempt to correct ill formatted references. This is an
|
118
117
|
option, you can disable it by setting the option VFY_URLS to “no” in the
|
119
|
-
configuration.
|
120
|
-
|
118
|
+
configuration. Beware that mailto: links are not recognized and cannot be
|
119
|
+
corrected. See the explanations for VFY_URLS, below.
|
121
120
|
|
122
121
|
Dialog to override settings
|
123
122
|
---------------------------
|
@@ -130,7 +129,7 @@ have not yet been set in the configuration.
|
|
130
129
|
* Signatures, as set in the configuration **can be ignored**. Either
|
131
130
|
a default signature will appear as set in flnews or none.
|
132
131
|
* Custom Headers, if configured, can be **omitted**.
|
133
|
-
*
|
132
|
+
* The X-No-Archive header, if set for the current newsgroup, **can be
|
134
133
|
ignored**.
|
135
134
|
* The verification & correction of references **can be disabled**.
|
136
135
|
* Logging can be **switched off**, if set.
|
@@ -158,11 +157,6 @@ categories:
|
|
158
157
|
|
159
158
|
* Variables defining the new or altered content.
|
160
159
|
|
161
|
-
*ATTENTION*: Most problems that occurred with recent versions of
|
162
|
-
*flnews_post_proc* were caused by inadequate option values and very often ill
|
163
|
-
chosen or mal formatted regular expressions. PSE double check your
|
164
|
-
configuration, if the program does not seem to work normally.
|
165
|
-
|
166
160
|
**FUP_NAME**
|
167
161
|
A Regular Expression, describing the string which contains the name of
|
168
162
|
previous poster who is the author of a quoted post. This string is
|
@@ -172,7 +166,7 @@ Ruby, noted as a String. Beware to mask a backslash '\\' by another one,
|
|
172
166
|
ike in the example. A capture-group '()' serves to extract the name from the
|
173
167
|
match result.
|
174
168
|
|
175
|
-
Leave this field empty to keep the default from the
|
169
|
+
Leave this field empty to keep the default from the FLNews configuration
|
176
170
|
intact.
|
177
171
|
|
178
172
|
CONTENT: A String equivalent of a regular expression.
|
@@ -205,15 +199,12 @@ intact.
|
|
205
199
|
|
206
200
|
CONTENT: A newsgroup or regexp per line, followed by a colon, a space and a String
|
207
201
|
|
208
|
-
DEFAULT: As configured in
|
202
|
+
DEFAULT: As configured in FLNews
|
209
203
|
|
210
204
|
EXAMPLE: _alt.test: "Thus spoke #\{fup_name\} on that baleful #\{fup_date\}:"_
|
211
205
|
|
212
206
|
**GROUP_SIGS**
|
213
207
|
A signature line per Newsgroup.
|
214
|
-
If a file is named instead, the program will pick randomly one signature from
|
215
|
-
that file. The file should contain signatures, separated by 1 empty line.
|
216
|
-
|
217
208
|
ATTN! In multi line signatures, you have to use \r\n for line breaks.
|
218
209
|
|
219
210
|
CONTENT: A newsgroup or regexp per line, followed by a colon, a space and a String.
|
@@ -221,7 +212,6 @@ intact.
|
|
221
212
|
DEFAULT: As configured in flnews
|
222
213
|
|
223
214
|
EXAMPLE: alt.test: _"Signature for alt.test\\\\r\\\\nsecond line"_
|
224
|
-
EXAMPLE: comp.*: /home/user/.my_sigs
|
225
215
|
|
226
216
|
**CUSTOM_HEADERS**
|
227
217
|
Additional headers for the outgoing article
|
@@ -235,10 +225,9 @@ intact.
|
|
235
225
|
_\- 'X-My-Header: nothing fancy'_
|
236
226
|
_\- 'X-Another-Header: care not!'_
|
237
227
|
|
238
|
-
**
|
239
|
-
|
240
|
-
|
241
|
-
be set.
|
228
|
+
**XNAY_GROUPS**
|
229
|
+
The newsgroups, where a header X-No-Archive: YES shall be set.
|
230
|
+
**ATTN** As of 2024, this header might serve no purpose any more.
|
242
231
|
|
243
232
|
CONTENT: a dash and space, then a String, containing the name of the group or
|
244
233
|
a regexp.
|
@@ -307,11 +296,15 @@ the original message-body contains text marked for use as such a footnote. See
|
|
307
296
|
**VFY_URLS**
|
308
297
|
A Boolean constant. It determines if the program shall verify and possibly
|
309
298
|
try to correct URLs. Even if URLs are identified as such, only a few
|
310
|
-
manipulations are attempted :
|
299
|
+
manipulations are attempted :
|
311
300
|
|
312
301
|
* Angular brackets '<' and '>' are added, if missing
|
302
|
+
* Article-references are prepended with "news:", if missing
|
313
303
|
* Slashes are added, if they are found missing after "http(s):"
|
314
304
|
|
305
|
+
ATTN! The program is unable to discern "mailto:" and "news:" references. If
|
306
|
+
neither is given, but '@' is present, "news:" is automatically prepended.
|
307
|
+
|
315
308
|
If the variable is not set, a value 'yes' is assumed.
|
316
309
|
|
317
310
|
CONTENT: One of YES, yes, NO, no, and other variations of case.
|
@@ -326,7 +319,7 @@ A dialog may be displayed which allows you to disable any of these
|
|
326
319
|
four options, so that the defaults from flnews prevail.
|
327
320
|
|
328
321
|
ATTN! Canceling the dialog or pushing the Esc-key does interrupt
|
329
|
-
the process.
|
322
|
+
the process. Flnews will not post the article.
|
330
323
|
|
331
324
|
Set this option to no, NO or similar to disable the dialog.
|
332
325
|
|
data/bin/flnews_post_proc
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
#!/bin/env ruby
|
2
2
|
#encoding: UTF-8
|
3
|
-
|
4
3
|
=begin
|
5
4
|
/***************************************************************************
|
6
|
-
* ©2023-
|
5
|
+
* ©2023-2023, Michael Uplawski <michael.uplawski@uplawski.eu> *
|
7
6
|
* *
|
8
7
|
* This program is free software; you can redistribute it and/or modify *
|
9
8
|
* it under the terms of the DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE *
|
@@ -22,73 +21,25 @@ if ! /linux/ =~ RUBY_PLATFORM
|
|
22
21
|
exit false
|
23
22
|
end
|
24
23
|
|
25
|
-
# needs the ruby-filemagic gem
|
26
|
-
# require 'filemagic'
|
27
|
-
# require 'marcel'
|
28
24
|
require 'tempfile'
|
29
|
-
|
30
25
|
require_relative '../lib/override'
|
31
26
|
require_relative '../lib/flnews_post_proc'
|
32
27
|
require_relative '../lib/basic_logging'
|
33
28
|
require_relative '../lib/configuration'
|
34
|
-
require_relative '../lib/version'
|
35
29
|
|
36
30
|
self.extend(BasicLogging)
|
37
|
-
|
38
|
-
def usage
|
39
|
-
usage = "\nWhat do you want me to do? Where is the article to post-process?"
|
40
|
-
usage << "\nUsage: "
|
41
|
-
usage << "\n\t#{$0} < article.text"
|
42
|
-
info usage
|
43
|
-
STDERR.puts usage
|
44
|
-
exit false
|
45
|
-
end
|
46
|
-
|
47
|
-
msg = PROGNAME.dup << ' ' << PROGVERSION << ' starting'
|
48
|
-
msg = "–––––– " << msg << " ––––––"
|
49
|
-
info msg
|
50
31
|
# Get a configuration
|
51
|
-
# this call results in the configuration file to be
|
52
|
-
# read and interpreted. As the log depends on the
|
53
|
-
# configuration, errors may render the debug-log
|
54
|
-
# unavailable. See STDERR in these cases, i.e.
|
55
|
-
# call the program on the command-line and pipe-in
|
56
|
-
# a message. Is this okay?
|
57
|
-
debug 'creating config'
|
58
32
|
config = Configuration::instance
|
59
33
|
|
60
|
-
#
|
61
|
-
# ... Forgot what this should be good for.
|
34
|
+
# store the path to the main executable
|
62
35
|
# config.set(:BINDIR, File::dirname(__FILE__) )
|
63
36
|
|
64
37
|
# Only if data is on STDIN
|
65
38
|
if (!STDIN.tty?)
|
66
39
|
# read from STDIN
|
67
40
|
artext = ARGF.read
|
68
|
-
|
69
41
|
# There is content, create the post-processor.
|
70
|
-
if !artext.strip.empty?
|
71
|
-
=begin
|
72
|
-
# unused
|
73
|
-
if (['news', 'rfc822'].none? {|m| mime.start_with?('message/' << m) } )
|
74
|
-
# Not a pure news message
|
75
|
-
# Add more reactions, as you stumble upon them ...
|
76
|
-
warn ("Input is of wrong mime-type " << mime.split(';')[0])
|
77
|
-
|
78
|
-
# Javascript okay
|
79
|
-
if (['javascript'].any? {|m| mime.start_with?('application/' << m)} )
|
80
|
-
warn 'Input contains java-script code!'
|
81
|
-
# C okay
|
82
|
-
elsif(['x-c'].any? {|m| mime.start_with?('text/' << m)} )
|
83
|
-
warn 'Input contains C- or C++ code!'
|
84
|
-
# Ruby okay
|
85
|
-
elsif(['x-ruby'].any? {|m| mime.start_with?('text/' << m) })
|
86
|
-
warn 'Input contains Ruby-code!'
|
87
|
-
else
|
88
|
-
warn 'Input contains other things than plain-text, but I cannot say, what.'
|
89
|
-
end
|
90
|
-
end
|
91
|
-
=end
|
42
|
+
if !artext.strip.empty?
|
92
43
|
#----------->
|
93
44
|
# Allow to override the configuration,
|
94
45
|
# if not disabled (default is true)
|
@@ -107,9 +58,8 @@ if (!STDIN.tty?)
|
|
107
58
|
debug('new config: ' << config.inspect)
|
108
59
|
end
|
109
60
|
#<--------------
|
110
|
-
# Do it:
|
111
61
|
pp = PostProcessor.new(artext)
|
112
|
-
# and
|
62
|
+
# ... and print its result.
|
113
63
|
article = pp.article
|
114
64
|
if article
|
115
65
|
# -------------> The main objective <------
|
@@ -120,9 +70,15 @@ if (!STDIN.tty?)
|
|
120
70
|
# whatever.
|
121
71
|
exit false
|
122
72
|
else
|
123
|
-
error( "Cannot read the article, no content" )
|
73
|
+
error( "Cannot read the article, no content" )
|
124
74
|
end
|
125
75
|
else
|
126
|
-
usage
|
76
|
+
usage = "\nWhat do you want me to do? Where is the article to post-process?"
|
77
|
+
usage << "\nUsage: "
|
78
|
+
usage << "\n\t#{$0} < article.text"
|
79
|
+
info usage
|
80
|
+
STDERR.puts usage
|
81
|
+
exit false
|
127
82
|
end
|
83
|
+
|
128
84
|
# Ω
|