flnews_post_proc 1.41 → 1.43

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d1a635207d4ca4d8fa516c00b23716f0446fa015bd26527483686895a4d37a8
4
- data.tar.gz: 99a27fa42f530982a3854fb783f69146fdf62a4910f0145dc7551a4e6d7ec4b2
3
+ metadata.gz: a84f5336c8383ef6fb884ac87a9ec3d0af44ab8acc03796746abae3046058b1f
4
+ data.tar.gz: 17fa345dc7971716a337ad79870850ec9746dc14bc6220eac513f923b33d1898
5
5
  SHA512:
6
- metadata.gz: ef0f0e4c3e3b04cb1c3c1b3213ec4ef2d7c5ec8909bd7d22d581269953c4a1283c5263680990d0ff5a085077f01ddbc8b2808f90b0052c8bbbb169bae8d9622a
7
- data.tar.gz: 387191fb0c3bdc9c434c970ee2b72de669dbd9d66791eb8a65c987e7ef3b6d523e39d56ebbdf2c2471bcd9897060f151c3c710bd6d03f6eeb7694e621c03e1b6
6
+ metadata.gz: 2b893868b1eabb86ede03c8bdaa7c8c1f78fc456932f17f491703db310e94d8902bcd19f45e6751fb7738a855415e69df1938fedb258078c43029d03048f809d
7
+ data.tar.gz: 9661e25f26f573839cba32f2eef2032577e37e710357af202e6fa9e863f863c41c336ffa9e6e904f5a9a14314cd7decedcaf18a44c3847ee686a71d9e0e4f955
data/README.md CHANGED
@@ -93,14 +93,14 @@ some users may not always agree with the result and for arbitrary reasons:
93
93
  Custom headers may be defined in the configuration file for the program
94
94
  and will then be added to each outgoing post.
95
95
 
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.
96
+ * The Archive- and X-No-Archive headers are sometimes set to avoid that an
97
+ article be saved and stays available to search-engines (Google, notably).
98
+ Test- postings, for example, do probably not justify at all that they would
99
+ be referenced in search results. The post-processor program can impose the
100
+ Archive- and X-No-Archive header for all posts to certain newsgroups.
102
101
 
103
- **ATTN** As of 2024, this header might serve no purpose any more.
102
+ **ATTN** As of 2024, the X-No-Archive has lost most of its utility and it
103
+ is the decision of server operators to honor it or not.
104
104
 
105
105
  * If a news post contains many references to either other posts or Web
106
106
  pages, the text can be cluttered with URLs.
@@ -129,7 +129,7 @@ have not yet been set in the configuration.
129
129
  * Signatures, as set in the configuration **can be ignored**. Either
130
130
  a default signature will appear as set in flnews or none.
131
131
  * Custom Headers, if configured, can be **omitted**.
132
- * The X-No-Archive header, if set for the current newsgroup, **can be
132
+ * Archive- and X-No-Archive headers, if set for the current newsgroup, **can be
133
133
  ignored**.
134
134
  * The verification & correction of references **can be disabled**.
135
135
  * Logging can be **switched off**, if set.
@@ -225,9 +225,10 @@ intact.
225
225
  _\- 'X-My-Header: nothing fancy'_
226
226
  _\- 'X-Another-Header: care not!'_
227
227
 
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.
228
+ **NO_ARCHIVE_GROUPS**
229
+
230
+ The newsgroups, where the headers “Archive: no and “X-No-Archive: YES” shall
231
+ be set.
231
232
 
232
233
  CONTENT: a dash and space, then a String, containing the name of the group or
233
234
  a regexp.
@@ -390,38 +390,33 @@ own creations.</p>
390
390
  <h2>The limits of a basic newsreader — what the program can do</h2>
391
391
  <p>While the articles that flnews creates, are complete and ready to be posted,
392
392
  some users may not always agree with the result and for arbitrary reasons:</p>
393
- <ul>
394
- <li><p class="first">There may be inconveniences when you post to different newsgroups in
393
+ <ul class="simple">
394
+ <li>There may be inconveniences when you post to different newsgroups in
395
395
  different languages, as an introductory line which refers to a previous
396
396
  post can only be set once in the flnews-configuration. The consequence
397
397
  can be that your post to a french newsgroup begins with an introduction
398
398
  in English.
399
399
  My post-processor program can set an introductory line specifically
400
- chosen for one or several newsgroups.</p>
401
- </li>
402
- <li><p class="first">The same conflict arises, when you have set a standard signature-text and
400
+ chosen for one or several newsgroups.</li>
401
+ <li>The same conflict arises, when you have set a standard signature-text and
403
402
  would like to replace it against another, based on the newsgroup you are
404
403
  about to post to.
405
404
  The post-processor program sets specific signatures as configured for one
406
- or several newsgroups.</p>
407
- </li>
408
- <li><p class="first">Some custom headers may serve to convey additional information to
405
+ or several newsgroups.</li>
406
+ <li>Some custom headers may serve to convey additional information to
409
407
  interested readers of your post, like GnuPG key IDs, your language skills
410
408
  or the like. The signature may be a better choice than custom headers.
411
409
  You are free. I just mention face and x-face but prefer that you do not
412
410
  remember I did.
413
411
  Custom-headers may be defined in the configuration file for the program
414
- and will then be added to each outgoing post.</p>
415
- </li>
416
- <li><p class="first">The X-No-Archive header is sometimes set to avoid that an article be
417
- saved and stays available to search-engines (Google, notably). Test-
418
- postings, for example, do probably not justify at all that they would be
419
- referenced in search-results.
420
- The post-processor program can impose the X-No-Archive header for all
421
- posts to certain newsgroups.</p>
422
- <p><strong>ATTN</strong> Since 2024, this header might no longer serve any purpose.</p>
423
- </li>
424
- <li><p class="first">If a news post contains many references to either other posts or Web
412
+ and will then be added to each outgoing post.</li>
413
+ <li>The Archive- and the X-No-Archive header are sometimes set to avoid that an
414
+ article be saved and stays available to search-engines (Google, notably).
415
+ Test- postings, for example, do probably not justify at all that they would
416
+ be referenced in search-results.
417
+ The post-processor program can impose both headers for all posts to certain
418
+ newsgroups.</li>
419
+ <li>If a news post contains many references to either other posts or Web
425
420
  pages, the text can be cluttered with URLs.
426
421
  The post-processor can identify marked text fragments and transform them
427
422
  into footnotes, which will be attached as a list at the bottom of the
@@ -430,8 +425,7 @@ This works almost like the &lt;ref/&gt; link in Wikipedia, but the delimiter
430
425
  can be determined in the configuration file.
431
426
  Example (with %=):
432
427
  This is an object %=and this becomes the footnote, describing the object
433
- further=%</p>
434
- </li>
428
+ further=%</li>
435
429
  </ul>
436
430
  </div>
437
431
  <div class="section" id="dialog-to-override-settings">
@@ -445,8 +439,8 @@ have not yet been set in the configuration.</p>
445
439
  <li>Signatures, as set in the configuration <strong>can be ignored</strong>. Either
446
440
  a default signature will appear as set in flnews or none.</li>
447
441
  <li>Custom Headers, if configured, can be <strong>omitted</strong>.</li>
448
- <li>The X-No-Archive header, if set for the current newsgroup, <strong>can be
449
- ignored</strong>.</li>
442
+ <li>The Archive- and X-No-Archive headers, if set for the current newsgroup,
443
+ <strong>can be ignored</strong>.</li>
450
444
  <li>Logging can be <strong>switched off</strong>, if set.</li>
451
445
  </ul>
452
446
  <p>Pushing Esc or the cancle-button of the dialog interrupts the process, flnews
@@ -523,9 +517,9 @@ name of the header, ending in a colon and the value of the header.</p>
523
517
  <div class="line">- 'X-Another-Header: care not!'</div>
524
518
  </div>
525
519
  </dd>
526
- <dt><strong>XNAY_GROUPS</strong></dt>
527
- <dd><p class="first">The newsgroups, where a header X-No-Archive: YES shall be set.
528
- <strong>ATTN</strong> Since 2024, this header might no longer serve any purpose.</p>
520
+ <dt><strong>NO_ARCHIVE_GROUPS</strong></dt>
521
+ <dd><p class="first">The newsgroups, where the headers “Archive: no” and “X-No-Archive: YES shall
522
+ be set.</p>
529
523
  <p>CONTENT: a dash and space, then a String, containing the name of the group or a regexp.</p>
530
524
  <p>DEFAULT: empty</p>
531
525
  <div class="last line-block">
@@ -421,14 +421,14 @@ ne vous en souvenez pas.</p>
421
421
  <p>Ces entêtes, – Custom-Headers – peuvent être définis dans la configuration
422
422
  du logiciel et vont être utilisées dans chaque article sortant.</p>
423
423
  </li>
424
- <li><p class="first">L'entête « X-No-Archive » est parfois utilisé afin d'éviter l'archivage
425
- d'un article. Il ne devrait par conséquence pas être trouvé par les moteurs
426
- de recherche ( Google notamment ). Les articles dans les groupes de test, par
427
- exemple, ne valent probablement pas qu'on les trouve parmi les résultats des
428
- recherches.</p>
424
+ <li><p class="first">Les entêtes « Archive » et « X-No-Archive » sont parfois utilisés afin
425
+ d'éviter l'archivage d'un article. Il ne devrait par conséquence pas être
426
+ trouvé par les moteurs de recherche ( Google notamment ). Les articles dans
427
+ les groupes de test, par exemple, ne valent probablement pas qu'on les trouve
428
+ parmi les résultats des recherches.</p>
429
429
  <p>Avec flnews_post_proc vous pouvez décider et imposer que vos articles dans
430
- certains newsgroups contiendront d'office une entête <strong>X-No-Archive: Yes</strong>.</p>
431
- <p><strong>ATTN</strong> Depuis l'année 2024, cet entête n'a probablement plus de fonction.</p>
430
+ certains newsgroups contiendront d'office les deux entêtes <strong>Archive: no</strong> et
431
+ <strong>X-No-Archive: Yes</strong>.</p>
432
432
  </li>
433
433
  <li><p class="first">Certains messages mentionnent d'autres articles ou des URLs de pages Web.
434
434
  S'ils sont nombreux, ces références peuvent déranger la lecture à cause de
@@ -456,7 +456,8 @@ des options, qui ne l'ont pas été auparavant :</p>
456
456
  <li>Signatures, comme définis dans la configuration <strong>peuvent être ignorées</strong>.
457
457
  Soit une signature par défaut sera appliquée, si prévue, ou aucune.</li>
458
458
  <li>Entêtes supplémentaires, si définis, peuvent rester absentes de l'article.</li>
459
- <li>L'entête X-No-Archive, si prévu pour le newsgroup choisi, peut être ignoré.</li>
459
+ <li>Les entêtes Archive et X-No-Archive, si prévus pour le newsgroup choisi,
460
+ peuvent être ignorés.</li>
460
461
  <li>L'auto correction de URLs et références à d'autres articles peut être
461
462
  désactivé.</li>
462
463
  <li>L'écriture d'un protocole peut être arrêtée.</li>
@@ -550,9 +551,9 @@ l'entête.</p>
550
551
  <div class="line">- 'X-Another-Header: care not!'</div>
551
552
  </div>
552
553
  </dd>
553
- <dt><strong>XNAY_GROUPS</strong></dt>
554
- <dd><p class="first">Les newsgroups, où une entête X-No-Arcive: YES doit être présent.
555
- <strong>ATTN</strong> Depuis l'année 2024, cet entête n'a probablement plus de fonction.</p>
554
+ <dt><strong>NO_ARCHIVE_GROUPS</strong></dt>
555
+ <dd><p class="first">Les newsgroups, où les entêtes « Archive: no » et « X-No-Archive: yes »
556
+ doivent être présents.</p>
556
557
  <p>CONTENU : Un trait d'union et un espace, puis une chaîne de caractères,
557
558
  contenant le nom du groupe ou une expression.</p>
558
559
  <p>PAR DÉFAUT : Vide</p>
Binary file
Binary file
Binary file
Binary file
@@ -60,14 +60,12 @@ some users may not always agree with the result and for arbitrary reasons:
60
60
  Custom-headers may be defined in the configuration file for the program
61
61
  and will then be added to each outgoing post.
62
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.
63
+ * The Archive- and the X-No-Archive header are sometimes set to avoid that an
64
+ article be saved and stays available to search-engines (Google, notably).
65
+ Test- postings, for example, do probably not justify at all that they would
66
+ be referenced in search-results.
67
+ The post-processor program can impose both headers for all posts to certain
68
+ newsgroups.
71
69
 
72
70
  * If a news post contains many references to either other posts or Web
73
71
  pages, the text can be cluttered with URLs.
@@ -91,8 +89,8 @@ have not yet been set in the configuration.
91
89
  * Signatures, as set in the configuration **can be ignored**. Either
92
90
  a default signature will appear as set in flnews or none.
93
91
  * Custom Headers, if configured, can be **omitted**.
94
- * The X-No-Archive header, if set for the current newsgroup, **can be
95
- ignored**.
92
+ * The Archive- and X-No-Archive headers, if set for the current newsgroup,
93
+ **can be ignored**.
96
94
  * Logging can be **switched off**, if set.
97
95
 
98
96
  Pushing Esc or the cancle-button of the dialog interrupts the process, flnews
@@ -187,9 +185,9 @@ categories:
187
185
  | - 'X-My-Header: nothing fancy'
188
186
  | - 'X-Another-Header: care not!'
189
187
 
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.
188
+ **NO_ARCHIVE_GROUPS**
189
+ The newsgroups, where the headers “Archive: no” and “X-No-Archive: YES shall
190
+ be set.
193
191
 
194
192
  CONTENT: a dash and space, then a String, containing the name of the group or a regexp.
195
193
 
@@ -73,16 +73,15 @@ et ce pour des raisons arbitraires :
73
73
  Ces entêtes, – Custom-Headers – peuvent être définis dans la configuration
74
74
  du logiciel et vont être utilisées dans chaque article sortant.
75
75
 
76
- * L'entête « X-No-Archive » est parfois utilisé afin d'éviter l'archivage
77
- d'un article. Il ne devrait par conséquence pas être trouvé par les moteurs
78
- de recherche ( Google notamment ). Les articles dans les groupes de test, par
79
- exemple, ne valent probablement pas qu'on les trouve parmi les résultats des
80
- recherches.
76
+ * Les entêtes « Archive » et « X-No-Archive » sont parfois utilisés afin
77
+ d'éviter l'archivage d'un article. Il ne devrait par conséquence pas être
78
+ trouvé par les moteurs de recherche ( Google notamment ). Les articles dans
79
+ les groupes de test, par exemple, ne valent probablement pas qu'on les trouve
80
+ parmi les résultats des recherches.
81
81
 
82
82
  Avec flnews_post_proc vous pouvez décider et imposer que vos articles dans
83
- certains newsgroups contiendront d'office une entête **X-No-Archive: Yes**.
84
-
85
- **ATTN** Depuis l'année 2024, cet entête n'a probablement plus de fonction.
83
+ certains newsgroups contiendront d'office les deux entêtes **Archive: no** et
84
+ **X-No-Archive: Yes**.
86
85
 
87
86
  * Certains messages mentionnent d'autres articles ou des URLs de pages Web.
88
87
  S'ils sont nombreux, ces références peuvent déranger la lecture à cause de
@@ -112,7 +111,8 @@ des options, qui ne l'ont pas été auparavant :
112
111
 
113
112
  * Entêtes supplémentaires, si définis, peuvent rester absentes de l'article.
114
113
 
115
- * L'entête X-No-Archive, si prévu pour le newsgroup choisi, peut être ignoré.
114
+ * Les entêtes Archive et X-No-Archive, si prévus pour le newsgroup choisi,
115
+ peuvent être ignorés.
116
116
 
117
117
  * L'auto correction de URLs et références à d'autres articles peut être
118
118
  désactivé.
@@ -218,9 +218,9 @@ variables définis dans ce fichier peuvent être classées en deux catégories :
218
218
  | - 'X-My-Header: nothing fancy'
219
219
  | - 'X-Another-Header: care not!'
220
220
 
221
- **XNAY_GROUPS**
222
- Les newsgroups, où une entête X-No-Arcive: YES doit être présent.
223
- **ATTN** Depuis l'année 2024, cet entête n'a probablement plus de fonction.
221
+ **NO_ARCHIVE_GROUPS**
222
+ Les newsgroups, où les entêtes « Archive: no » et « X-No-Archive: yes »
223
+ doivent être présents.
224
224
 
225
225
  CONTENU : Un trait d'union et un espace, puis une chaîne de caractères,
226
226
  contenant le nom du groupe ou une expression.
data/lib/body.rb CHANGED
@@ -203,19 +203,23 @@ class Body
203
203
  # handle <news:..@...>
204
204
  def handle_news(l)
205
205
  # ... “Do not trust nobody!”
206
- if l.include?('@') && ! l.include?('http:')
206
+ if l.include?('@') && ! l.include?('http:') && ! l.include?('https:')
207
207
  # And I forgot how this works. It does.
208
208
  l.split.collect do |ele|
209
209
  # angular brackets are there alright. Hurra.
210
210
  url = ele.match(/\<(.*)\>/)
211
211
  unless !url
212
212
  debug(' with angular brackets: ' << url.inspect)
213
- l = l.sub(url[1], 'news:' << url[1]) if !url[1].include?('mailto')
213
+ l = l.sub(url[1], 'news:' << url[1]) if !url[1].start_with?('mailto') && !url[1].start_with?('news')
214
214
  else
215
215
  url = ele.match(/\S+@(\.|[^\p{P}]+)\S+/)
216
216
  if url
217
217
  debug(' withOUT angular brackets: ' << url.inspect)
218
- l = l.sub(url[0], '<news:' << url[0] << '>') if !url[0].include?('mailto')
218
+ if !url[0].start_with?('mailto') && !url[0].start_with?('news')
219
+ l.sub!(url[0], 'news:' << url[0] )
220
+ end
221
+ l.sub!('news:', '<news:')
222
+ l.sub!(url[0], url[0] << '>')
219
223
  end
220
224
  end
221
225
  end # url_strs = collect
@@ -235,13 +239,13 @@ class Body
235
239
  debug( 'try to match http-link')
236
240
  begin
237
241
  # missing slashes ?
238
- match = str.match(/(https?):(\/{2})/)
242
+ match = str.match(/(https?):(\/*)/)
239
243
  if (!match || match.length != 3 || match[2] != '//')
240
- debug 'cannot find slashes in the URL'
244
+ debug 'cannot find (enough) slashes in the URL'
241
245
  if str.match(/https:/)
242
- nstr = str.sub(/https:/, "https://")
246
+ nstr = str.sub(/https:\/*/, "https://")
243
247
  elsif str.match(/http:/)
244
- nstr = str.sub(/http:/, "http://")
248
+ nstr = str.sub(/http:\/*/, "http://")
245
249
  end
246
250
  debug ' with slashes: ' << nstr
247
251
  end
@@ -252,8 +256,8 @@ class Body
252
256
  match = nstr.match(/\<?(https?:\/\/[^\>]*)\>?/)
253
257
  # get the darned URL already!
254
258
  url = match[1] if match
255
- # nstr = with_angular_brackets(nstr, url)
256
- return l.sub(str, nstr)
259
+ # nstr = with_angular_brackets(nstr, url)
260
+ l.sub!(str, nstr)
257
261
  rescue Exception => ex
258
262
  # this had looked intelligent, once.
259
263
  line = __LINE__
@@ -264,6 +268,7 @@ class Body
264
268
  exit false
265
269
  end
266
270
  end
271
+ return l
267
272
  end
268
273
  end
269
274
  # Ω
data/lib/version.rb CHANGED
@@ -14,8 +14,8 @@
14
14
  =end
15
15
 
16
16
  PROGNAME = 'flnews_post_proc'
17
- PROGVERSION = "1.41"
17
+ PROGVERSION = "1.43"
18
18
  AUTHORS = "Michael Uplawski"
19
19
  EMAIL = "michael.uplawski@uplawski.eu"
20
20
  YEARS = "2023 - 2024"
21
- SUMMARY = "Additional Header 'Archive: no', when No Archive is chosen."
21
+ SUMMARY = "Bugfix: reduce number of slashes in http: urls to 2"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flnews_post_proc
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.41'
4
+ version: '1.43'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Uplawski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-18 00:00:00.000000000 Z
11
+ date: 2024-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diffy
@@ -84,5 +84,5 @@ requirements: []
84
84
  rubygems_version: 3.4.20
85
85
  signing_key:
86
86
  specification_version: 4
87
- summary: 'Additional Header ''Archive: no'', when No Archive is chosen.'
87
+ summary: 'Bugfix: reduce number of slashes in http: urls to 2'
88
88
  test_files: []