"C-Period" to find my messages; "C-Insert" to copy post URL to clipboard
[knntp.git] / nntpcvt.d
blobab05fc6ec6c120aa7940bebe390d0caa336a8941
1 /* DigitalMars NNTP reader
2 * coded by Ketmar // Invisible Vector <ketmar@ketmar.no-ip.org>
3 * Understanding is not required. Only obedience.
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 module nntpcvt is aliced;
20 import std.datetime;
22 import iv.cmdcon;
23 import iv.strex;
24 import iv.vfs;
25 import iv.vfs.io;
27 import nntp;
30 // ////////////////////////////////////////////////////////////////////////// //
31 void main (string[] args) {
32 if (args.length == 1) args ~= ["D", "digitalmars.D.announce", "digitalmars.D.internals", "digitalmars.D", "digitalmars.D.learn"];
34 foreach (string group; args[1..$]) {
35 writeln("=== GROUP: ", group, " ===");
37 auto fold = openOldTextDataForReading("./data_old/"~group~".knmt");
39 auto abase = new ArticleBase(group);
41 for (;;) {
42 Article art = fold.readOldArticleText();
43 if (!art.valid) break;
44 abase.insert(art);
45 abase[abase.length-1].updated = true;
46 //abase.selfCheck();
48 abase.selfCheck();
50 conwriteln(abase.length, " articles converted");
52 abase.writeUpdates();