I have modified version of getnewsgroupslist.js with optional
authentication support because use nntp.aioe.org server that don't need it.
http://paste.debian.net/1152067/
I share here because can be useful for another people
thanks!
--- getnewsgrouplist.js 2019-12-01 00:02:31.000000000 -0300
+++ ../mods/getnewsgrouplist.js 2020-06-14 16:36:18.134989504 -0300
@@ -2,21 +2,39 @@
"use strict";
-if(argc < 3) {
- print("usage: " + js.exec_file + " <user> <password> <host> [port] [pattern]");
+if(argc < 1) {
+ print("usage: " + js.exec_file + " -h <host> -p [port] -a [user:pass] -t [pattern]");
exit(0);
}
+var host = "";
+var port = 119;
+var auth = "";
+var name = "";
+var pass = "";
+var pattern = "";
+
+for(var i=0;i<argc;i++) {
+ switch (argv[i].toLowerCase()) {
+ case "-h":
+ host = argv[++i];
+ break;
+ case "-p":
+ port = argv[++i];
+ break;
+ case "-a":
+ auth = argv[++i];
+ break;
+ case "-t":
+ pattern = argv[++i];
+ break;
+ default:
+ // compatibilty no -params?
+ host = argv[0];
+ }
+}
+
var socket = new Socket();
-var name = argv[0]