flnews_post_proc 1.40

Sign up to get free protection for your applications and to get access to all the features.
data/doc/license.txt ADDED
@@ -0,0 +1,13 @@
1
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2
+ Version 2, December 2004
3
+
4
+ Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
5
+
6
+ Everyone is permitted to copy and distribute verbatim or modified
7
+ copies of this license document, and changing it is allowed as long
8
+ as the name is changed.
9
+
10
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12
+
13
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,334 @@
1
+ =======================
2
+ flnews_post_proc
3
+ =======================
4
+ ------------------------------------------
5
+ Post-Processor for the flnews newsreader
6
+ ------------------------------------------
7
+
8
+ SYNOPSIS
9
+ =======================
10
+
11
+ An article is piped-in to the post-processor. This is normally done
12
+ automatically as soon as the variable “post_proc“ in the flnews configuration
13
+ file is set to the flnews_post_proc.
14
+
15
+ Locally stored articles can be piped in to the post-processor, as needed
16
+ for testing purposes, with a command-line like the following:
17
+
18
+ **flnews_post_proc < article**
19
+
20
+ DESCRIPTION
21
+ =======================
22
+ The flnews newsreader is sufficient for Usenet access, i.e. to receive and read
23
+ articles from -, as well as to write and post articles to newsgroups.
24
+
25
+ When you compare news-clients, you will always notice the differences and
26
+ choose the software that you prefer. Flnews however, has the charm that you can
27
+ influence how the program itself works but also modify posts that flnews
28
+ produces, just before the program will transmit them to the chosen nntp-server.
29
+
30
+ The flnews_post_proc can add and change details of a post, in ways that are
31
+ currently not possible with flnews alone. As the program is configurable, it
32
+ can probably respond to the needs of some Usenet users. You should, however,
33
+ rather take it as an example for what can be done and an inspiration for your
34
+ own creations.
35
+
36
+ The limits of a basic newsreader — what the program can do
37
+ ----------------------------------------------------------
38
+ While the articles that flnews creates, are complete and ready to be posted,
39
+ some users may not always agree with the result and for arbitrary reasons:
40
+
41
+ * There may be inconveniences when you post to different newsgroups in
42
+ different languages, as an introductory line which refers to a previous
43
+ post can only be set once in the flnews-configuration. The consequence
44
+ can be that your post to a french newsgroup begins with an introduction
45
+ in English.
46
+ My post-processor program can set an introductory line specifically
47
+ chosen for one or several newsgroups.
48
+
49
+ * The same conflict arises, when you have set a standard signature-text and
50
+ would like to replace it against another, based on the newsgroup you are
51
+ about to post to.
52
+ The post-processor program sets specific signatures as configured for one
53
+ or several newsgroups.
54
+
55
+ * Some custom headers may serve to convey additional information to
56
+ interested readers of your post, like GnuPG key IDs, your language skills
57
+ or the like. The signature may be a better choice than custom headers.
58
+ You are free. I just mention face and x-face but prefer that you do not
59
+ remember I did.
60
+ Custom-headers may be defined in the configuration file for the program
61
+ and will then be added to each outgoing post.
62
+
63
+ * The X-No-Archive header is sometimes set to avoid that an article be
64
+ saved and stays available to search-engines (Google, notably). Test-
65
+ postings, for example, do probably not justify at all that they would be
66
+ referenced in search-results.
67
+ The post-processor program can impose the X-No-Archive header for all
68
+ posts to certain newsgroups.
69
+
70
+ **ATTN** Since 2024, this header might no longer serve any purpose.
71
+
72
+ * If a news post contains many references to either other posts or Web
73
+ pages, the text can be cluttered with URLs.
74
+ The post-processor can identify marked text fragments and transform them
75
+ into footnotes, which will be attached as a list at the bottom of the
76
+ post.
77
+ This works almost like the <ref/> link in Wikipedia, but the delimiter
78
+ can be determined in the configuration file.
79
+ Example (with %=):
80
+ This is an object %=and this becomes the footnote, describing the object
81
+ further=%
82
+
83
+ Dialog to override settings
84
+ ---------------------------
85
+ You can have a dialog displayed just before the post-processor is invoked, to
86
+ **disable** some configuration options. Provided that either YAD, Zenity,
87
+ Whiptail or only xterm are available on your computer, you can choose from
88
+ the following options. You **cannot** use the dialog to enable options which
89
+ have not yet been set in the configuration.
90
+
91
+ * Signatures, as set in the configuration **can be ignored**. Either
92
+ a default signature will appear as set in flnews or none.
93
+ * Custom Headers, if configured, can be **omitted**.
94
+ * The X-No-Archive header, if set for the current newsgroup, **can be
95
+ ignored**.
96
+ * Logging can be **switched off**, if set.
97
+
98
+ Pushing Esc or the cancle-button of the dialog interrupts the process, flnews
99
+ will not post the article.
100
+
101
+ You can disable the dialog, which ensures that all configured options will be
102
+ applied, without the need for further interaction (see below, option
103
+ OVERRIDE_CONFIG).
104
+
105
+ CONFIGURATION
106
+ ===============
107
+ On first execution of the program, a copy of the original configuration file is
108
+ created in */home/[user]/.flnews_post_proc.conf*
109
+ It is this file which is used from then on. If you delete it, it will be
110
+ recreated, on the next occasion, but your own changes will be lost.
111
+
112
+ The configuration file is in YAML syntax and full of explanations. The
113
+ variables defined in this file can be classified as belonging to one of two
114
+ categories:
115
+
116
+ * Variables describing values originally set by flnews, which should be used or
117
+ replaced. The important elements are usually matched in a capture group.
118
+
119
+ * Variables defining the new or altered content.
120
+
121
+ **FUP_NAME**
122
+ A Regular Expression, describing the string which contains the name of
123
+ previous poster who is the author of a quoted post. This string is
124
+ recognized in the original article and may be used with the fitting element
125
+ from *GROUP_INTRO*, below. The Regexp-format is that of the Regexp class in
126
+ Ruby, noted as a String. Beware to mask a backslash '\\' by another one,
127
+ like in the example. A capture-group '()' serves to extract the name from the
128
+ match result.
129
+
130
+ Leave this field empty to keep the default from the FLNews configuration
131
+ intact.
132
+
133
+ CONTENT: A String equivalent of a regular expression.
134
+
135
+ DEFAULT: EMPTY
136
+
137
+ EXAMPLE1: "On \\\\d+.\\\\d+.\\\\d{2,4} at \\\\d+:\\\\d+ **(.*)** wrote:"
138
+
139
+ EXAMPLE2: "**(.*)** wrote:"
140
+
141
+
142
+ **FUP_GROUP**
143
+ A Regular Expression, describing the string which contains the newsgroup
144
+ where the previous post, that you are referring to in the followup, had been
145
+ published.
146
+
147
+ Leave this field empty to ignore the precise group.
148
+
149
+ CONTENT: A String equivalent of a regular expression.
150
+
151
+ DEFAULT: EMPTY
152
+
153
+ EXAMPLE: "wrote in **(.*)**:"
154
+
155
+ **GROUP_INTROS**
156
+ Introductory strings, referring to the previous poster who is the author of a
157
+ quoted post. If you match the newsgroup of the post (see FUP_GROUP), you can
158
+ use these variables in the result.
159
+ Currently only %fup_name% and %fup_group% are reproduced in the resulting
160
+ introductory string.
161
+
162
+ CONTENT: A newsgroup or regexp per line, followed by a colon, a space and a String
163
+
164
+ DEFAULT: As configured in FLNews
165
+
166
+ EXAMPLE: alt.test: "Thus spoke %fup_name% on that baleful %fup_date%:"
167
+
168
+ **GROUP_SIGS**
169
+ A signature line per Newsgroup.
170
+ ATTN! In multi line signatures, you have to use \\r\\n for line breaks.
171
+
172
+ CONTENT: A newsgroup or regexp per line, followed by a colon, a space and a String.
173
+
174
+ DEFAULT: As configured in flnews
175
+
176
+ EXAMPLE: alt.test: "Signature for alt.test\\r\\nsecond line"
177
+
178
+ **CUSTOM_HEADERS**
179
+ Additional headers for the outgoing article
180
+
181
+ CONTENT: 1 line per header : a dash and space, then a String, comprising the
182
+ name of the header, ending in a colon and the value of the header.
183
+
184
+ DEFAULT: undefined
185
+
186
+ | EXAMPLE (2 headers):
187
+ | - 'X-My-Header: nothing fancy'
188
+ | - 'X-Another-Header: care not!'
189
+
190
+ **XNAY_GROUPS**
191
+ The newsgroups, where a header X-No-Archive: YES shall be set.
192
+ **ATTN** Since 2024, this header might no longer serve any purpose.
193
+
194
+ CONTENT: a dash and space, then a String, containing the name of the group or a regexp.
195
+
196
+ DEFAULT: empty
197
+
198
+ | EXAMPLE (1 group, 1 hierarchy):
199
+ | - "alt.test"
200
+ | - "^news.*"
201
+
202
+
203
+ **DEBUG_LOG**
204
+ The name of a file, where debug messages are written. Setting this
205
+ variable will enable the log. Leave empty to disable logging.
206
+
207
+ CONTENT: The name of a writable file, which will be created if inexistent
208
+ and overwritten if need be.
209
+
210
+ DEFAULT: empty
211
+
212
+ EXAMPLE: '/tmp/a_log-file.txt'
213
+
214
+ **LOG LEVEL**
215
+ One of debug, fatal, error, info, warn
216
+
217
+ **REFERENCES_SEPARATOR**
218
+ A symbol or sequence of symbols marking the end of the message-body and the
219
+ beginning of a list of “references” or “footnotes”. It will only appear, if
220
+ the original message-body contains text marked for use as such a footnote.
221
+ See *REFERENCES_DELIMITER*.
222
+
223
+ If the option is not defined or empty, the list of footnotes will appear
224
+ below the last line of the message body and no separator will be inserted.
225
+
226
+ CONTENT: A quoted symbol or sequence of symbols.
227
+
228
+ DEFAULT: empty
229
+
230
+ EXAMPLE: '---------'
231
+
232
+ **REFERENCES_DELIMITER**
233
+ A sequence of at least two symbols marking the beginning of a text which will
234
+ serve as footnote (or reference). The **reversed sequence** musst be used to
235
+ mark the end of the text. The presence of this sequence or symbol in the
236
+ original message body will cause the enclosed text to be moved below the
237
+ message body. The *REFERENCES_SEPARATOR*, if defined, will separate the
238
+ message from the list of footnotes.
239
+ If this option is not defined or empty, footnotes are not created.
240
+
241
+ CONTENT a quoted symbol or sequence of symbols.
242
+
243
+ DEFAULT: none/empty
244
+
245
+ EXAMPLE: '%?'
246
+
247
+ **REFERENCE_FORMAT**
248
+ A format-string, using %s for a number, replacing the reference-
249
+ text in the message body.
250
+
251
+ DEFAULT: " %s)" -> becomes 1) ... 2) ... 3)
252
+
253
+ EXAMPLE: "(%s)" -> becomes (1) ... (2) ... (3)
254
+
255
+ **VFY_URLS**
256
+ A Boolean constant. It determines if the program shall verify and possibly
257
+ try to correct URLs. Even if URLs are identified as such, only a few
258
+ manipulations are attempted :
259
+ * Angular brackets '<' and '>' are added, if missing
260
+ * Article-references are prepended with "news:", if missing
261
+ * Slashes are added, if they are found missing after "http(s):"
262
+
263
+ ATTN! The program is unable to discern "mailto:" and "news:" references. If
264
+ neither is given, but '@' is present, "news:" is automatically prepended.
265
+
266
+ If the variable is not set, a value 'yes' is assumed.
267
+
268
+ CONTENT: One of YES, yes, NO, no, and other variations of case.
269
+
270
+ DEFAULT: yes
271
+
272
+ Example: ... I let you guess.
273
+
274
+ **OVERRIDE_CONFIG**
275
+ A Boolean constant. You can choose to override the following
276
+ configuration options before an article is posted:
277
+ GROUP_SIGS, XNAY_GROUPS, CUSTOM_HEADERS and DEBUG_LOG.
278
+ A dialog may be displayed which allows you to disable any of these
279
+ four options, so that the defaults from flnews prevail.
280
+
281
+ ATTN! Canceling the dialog or pushing the Esc-key does interrupt
282
+ the process. Flnews will not post the article.
283
+
284
+ Set this option to no, NO or similar to disable the dialog.
285
+
286
+ DEFAULT: yes
287
+
288
+ EXAMPLE: No
289
+
290
+ Other Information
291
+ =================
292
+
293
+ Testing
294
+ -------
295
+ The effects that the execution of the program will have on a posting can be
296
+ verified in two ways:
297
+
298
+ 1. By piping-in a post that had previously been saved to a file:
299
+
300
+ **:~$ /usr/local/bin/[post-processor] < [test-article]**
301
+
302
+ This will show the resulting new version of the article on screen, but you
303
+ can also pipe the output into another file. This is a great way to test a
304
+ program during development or to test your own configuration of the program.
305
+ 2. By posting directly into a test-newsgroup (like alt.test or similar). This
306
+ is mandatory before you really post to thematic newsgroups and when the
307
+ settings of the post-processor will affect the article.
308
+
309
+
310
+ Source-Code
311
+ -----------
312
+ The gem-file that you get with the gem-utility or from rubygems.org contains
313
+ all the code of the program and some documentation (this page notably). To read
314
+ its content, you must
315
+
316
+ 1. untar the gem-file with tar -xf flnews_post_proc-0.1.gem
317
+ 2. uncompress the data.gz archive: gunzip data.gz
318
+ 3. untar the resultig data.tar archive: tar -xf data.tar
319
+
320
+ This creates the directories bin, doc and lib.
321
+
322
+ License
323
+ -------
324
+ flnews_post_proc is distributed under the conditions of the WTFPL-2.0 or later
325
+ License (see http://www.wtfpl.net/txt/copying/ or license-text in the doc
326
+ directory of the gem-file).
327
+
328
+ Author
329
+ ------
330
+ | flnews_post_proc has been developed by
331
+ | Michael Uplawski <michael.uplawski@uplawski.eu>
332
+
333
+ Ω
334
+ ==