Re: FAQ Posting problem
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: FAQ Posting problem

From: VK <schools_ring@yahoo.com>
Date: Sat Apr 29 2006 - 22:51:04 CEST

Jim Ley wrote:
> I have a news-server... I'm posting from it now...

And I say again that if you have a log/pass for NNTP server then the
previously posted code is sufficient.

Just in case I got in troubles to get a temporary authen NNTP account
and the code below works just fine. It is a self contained fully
functional program, you only need to insert the content generating
block, uncomment $req->post and use whatever @message you have.

The details are regular:

Whatch single/double quotes if editing (in Perl single quote literals
are not resolved as opposed to double quoted). To not get in troubles
with fancy login/password like @foo$bar and such use single quotes on
them.

check out that shebang (#!/usr/bin/perl) corresponds to your Perl
installation (there are three possible pathes and I cannot guess the
right one, edit if needed).

upload as ASCII

chmod 755

notify CRON (I guess you have a web interface for it)

#!/usr/bin/perl
use Net::NNTP;

# Insert current block generating
# Usenet-compliant message
# in the form of array of strings
# further referred as @message

$req = Net::NNTP->new('your.news.server') or die($!);
$req->authinfo('yourLogin', 'yourPassword');
$req->group('comp.lang.javascript');
if ($req->postok()) {
 #$req->post(@message);
 print "Content-Type: text/plain\n\n";
 print "Connected. Ready to post";
}
else {
 print "Content-Type: text/plain\n\n";
 print "Oops...";
}
$req->quit();

exit(0);
Received on Mon May 1 05:27:10 2006