Article View: news.software.nntp
Article #43546problem with this script
From: Bilbo
Date: Thu, 20 Jan 2000 00:00
Date: Thu, 20 Jan 2000 00:00
100 lines
3718 bytes
3718 bytes
Please help.... I would like to automate a posting to a newsgroup, so I've written a script to do the posting and will have it run on a cron to make a weekly posting to a particular news group. I have an ISP, but only allows you to connect to the news server when you have connected to the internet through them. So, my news server cannot be used.... I have found an open news server that will allow postings and I have succesfully posted to some newsgroups via the script below. The problem is finding a news server that carries the newsgroup uk.adverts.telecom.mobile, allows open connection and will allow posts to be made. I've been unsuccessful, so far, in finding suitable news servers. It's a big job, (even when using News Hunter or www.jammed.com ) - it seems that the news servers that appear to carry this newsgroup allow posting, and my script (below) will recognise this but then gets the error "Can't Post". The script DOES post succesfully to other newsgroups, like alt.test, uk.test etc so it's very confusing :-( Maybe the code is correct and I just need to find a suitable news server that carries this newsgroup and allows posts to be made? I'm no expert on NNTP, so perhaps there is something wrong with my script, or that certain newsgroups are more stringent on the header sent? If you feel that the script is fine and the answer is for me to *subscribe* to a news server (rather than hunt for an open one), can you recommend one? TIA for any suggestions. Please respond to this newsgoup or email me at bilbo_baggins50@hotmail.NOSPAM.com (please remove .NOSPAM to email me) ----------- PERL CODE FOLLOWS ----------- #!/usr/bin/perl use Net::NNTP; $nntp= Net::NNTP->new; #use default port and options #$ns="freenews.netfront.net"; #NEWS SERVER TO CONNECT TO $ns="newssrv2.hrz.uni-oldenburg.de"; $ng="alt.test"; #NEWSGROUP #$ng="uk.adverts.telecom.mobile"; print "\n\nGETTING READY TO CONNECT...\n"; $server= Net::NNTP->new($ns) or die "can't connect to news server $@\n"; print "Ok, connected to news server: $ns\n"; ($narticles, $first, $last, $name) = $server->group($ng) or die "can't select newsgroup:$ng\n"; print "Ok, have selected newsgroup: $ng\n"; @lines="From: bilbo_baggins50\@hotmail.NOSPAM.com (bilbo) Newsgroups: $ng Subject: $ns Test Organization: Test Labs Inc Distribution: world X-No-Archive: Yes This is just a test message Testing 1 2 3... posted via $ns bilbo_baggins50\@hotmail.NOSPAM.com (remove .NOSPAM to email me) "; $server->postok() or warn "server didn't tell me i could post: \n"; print "Ok, news server allows posting...\n"; $server->post(@lines) or die "can't post: $!\n"; print "\n\nPOSTED SUCCESSFULLY!!!!"; ------------- END PERL CODE -----------
Technical Details
Message-ID:
<8683dq$rts$1@nclient11-gui.server.virgin.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.lang.perl.modules.mbox.zip!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <8683dq$rts$1@nclient11-gui.server.virgin.net> Subject: problem with this script Date: Thu, 20 Jan 2000 00:00:00 +0000 From: "Bilbo" <bilbo_baggins50@hotmail.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.lang.perl.modules.mbox.zip!not-for-mail X-Deja-AN: 575466957 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Complaints-To: abuse@virgin.net X-Trace: nclient11-gui.server.virgin.net 948408570 28604 62.252.101.39 (20 Jan 2000 22:49:30 GMT) Organization: Virgin Net Usenet Service X-MSMail-Priority: Normal NNTP-Posting-Date: 20 Jan 2000 22:49:30 GMT Newsgroups: comp.lang.perl.misc,comp.lang.perl.modules,news.software.nntp