🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: rocksolid.nodes
Article #293

Re: hey, what do know ? vichan supports nntp

#293
From: anonymous
Date: Sat, 23 May 2020 15:34
82 lines
4087 bytes
>Do you mean put the message into some holding location and try again in the future to apply it to vichan's database of articles? 

Yes, this is more or less what I meant.


>One thing you can do is grep overview for the message-id of the referenced article. 

I used message_read for now, and made one new file to follow the status of the exports. Actually, this kind of thing would be better done in one of the existing code bases, this was just the fastest way for me to test the concept.

The code lines below export any new message that is found into a format that is translated later in the new post.php of vichan.

So I guess I could call this script at the end of spoolnews (or maybe just insert it).

On the other end, I have a modified post.php, which reads the oldest message (by name) and imports it. I could not modify it in a way yet that would allow to cycle through all existing messages, so the whole setup is just an interim solution yet (but it is importing the messages right now).

later more,

trw



<?php

  include "config.inc.php";
  include "$file_newsportal";
  include 'message.inc.php';

$groups = array(
	'rocksolid.nodes',
	'rocksolid.nodes.help',
	'rocksolid.nodes.announce',
	'rocksolid.shared.encryption',
	'rocksolid.shared.entertainment',
	'rocksolid.shared.freenet',
	'rocksolid.shared.general',
	'rocksolid.shared.hacking',
	'rocksolid.shared.helpdesk',
	'rocksolid.shared.i2p',
	'rocksolid.shared.linux',
	'rocksolid.shared.news',
	'rocksolid.shared.offtopic',
	'rocksolid.programming',
	'rocksolid.shared.rocksolid',
	'rocksolid.shared.security',
	'rocksolid.social',
	'rocksolid.shared.test',
	'rocksolid.shared.tor',
);
$watermarks = json_decode(file_get_contents('watermarks.json'), true);
$update = false;
foreach($groups as $group){
	echo($group . "nr");
	for ($i = 0; $i < 1000; $i++){
		if(!in_array($i,$watermarks[$group])){
			$message = message_read($i, 0, $group);
			if($message){
				echo("processing message # " . $i . " from group " . $group . "nr");
				$paddedI = str_pad($i, 5, '0', STR_PAD_LEFT);
				$jsonFile = fopen('/var/www/html/vi/vichan-master/debug/' . $paddedI . '_' . $group . '.json', 'w');
				fwrite($jsonFile, json_encode((array) $message, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
				fclose($jsonFile);
				array_push($watermarks[$group],$i);
				$update = true; 
			}
		}
	}
}
if($update){
	echo("saving updated watermarksnr");
	$jsonWatermarks = fopen('watermarks.json', 'w');
	fwrite($jsonWatermarks, json_encode((array) $watermarks, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
	fclose($jsonWatermarks);
} else {
	echo("no new files foundnr");
}
exit;
?>


-- 
Posted on def2
z5bqfv5v75kxy7pj.onion
Technical Details
Message-ID: <0aa95e99d0630d9dff411f409db00e5e$1@z5bqfv5v75kxy7pj.onion>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!apf9.newsdeef.eu!i2pn2.org!.POSTED!not-for-mail
References: <56148a22de20564af15e4ee0c7a2536e$1@news.novabbs.com> <c4b1c865ef480a6f4d9459af1391a116@def4> <4a2c95c3090fd2779b68fe50d43b2854$1@news.novabbs.com> <1b2bbbcb354ea383343edde8d8bdffe3$1@z5bqfv5v75kxy7pj.onion> <dfc3ccdd0ba2d83aa3febd427357defd$1@z5bqfv5v75kxy7pj.onion> <47921547e66d1985844c048b2f4a280f$1@z5bqfv5v75kxy7pj.onion> <746ad48c7dcd992903b0f09a875f10fd$1@z5bqfv5v75kxy7pj.onion> <208a215d095e2a90acdc545066307dbe$1@news.novabbs.com>

Show Full Headers
Complete Article Headers
Message-ID: <0aa95e99d0630d9dff411f409db00e5e$1@z5bqfv5v75kxy7pj.onion>
Subject: Re: hey, what do know ? vichan supports nntp
Date: Sat, 23 May 2020 15:34:00 +0000
From: anonymous@anon.com (anonymous)
References: <56148a22de20564af15e4ee0c7a2536e$1@news.novabbs.com> <c4b1c865ef480a6f4d9459af1391a116@def4> <4a2c95c3090fd2779b68fe50d43b2854$1@news.novabbs.com> <1b2bbbcb354ea383343edde8d8bdffe3$1@z5bqfv5v75kxy7pj.onion> <dfc3ccdd0ba2d83aa3febd427357defd$1@z5bqfv5v75kxy7pj.onion> <47921547e66d1985844c048b2f4a280f$1@z5bqfv5v75kxy7pj.onion> <746ad48c7dcd992903b0f09a875f10fd$1@z5bqfv5v75kxy7pj.onion> <208a215d095e2a90acdc545066307dbe$1@news.novabbs.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!apf9.newsdeef.eu!i2pn2.org!.POSTED!not-for-mail
Newsgroups: rocksolid.nodes
Organization: def2
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org; posting-account="def2";
 logging-data="22718"; mail-complaints-to="usenet@i2pn2.org"
User-Agent: Rocksolid Light (news.novabbs.com/getrslight)
X-Rslight-Site: $2y$10$aSq.3cTlJqMmP3dtgqDVNOh4IO3I1ro6uNUM8upYzpkWT5g7ECH4C