News::Scan(3pm)
โจ NAME โจ
News::Scan โ the manual page you're reading is News::Scan(3pm), bestie, and it's about gathering and reporting Usenet newsgroup statistics. Obsessed. ๐ฆ
๐ธ SYNOPSIS ๐ธ
use News::Scan;
my $scan = News::Scan->new;
๐ DESCRIPTION ๐
Okay so real talk: this module hands you a class, and objects made from that class are literally built to gather and report Usenet newsgroup statistics. That's the whole vibe. โจ
๐ CONSTRUCTOR ๐
new ( [ OPTIONS ] )
OPTIONS is a list of named parameters, meaning you pass them as key-value pairs, no cap. The valid options are:
Groupโ the name of the newsgroup you wanna scan. ๐Fromโ this one has to be either'spool'or'NNTP'(case does NOT matter, we're chill like that). Anything else? Error, bestie โ see theerrormethod down below.'spool'means "yeah scan articles in a spool" (peep theSpooloption).'NNTP'means "pull those articles off my NNTP server" (peep theNNTPServeroption).Spoolโ the path to the spool directory holding the articles you want scanned. Ngl, this one gets ignored unlessFromis'spool'. ๐NNTPServerโ the NNTP server to grab articles from, written in the formserver:port, and both parts are optional โ checkNet::NNTPfor the semantics of leaving one or both out. Ignored unlessFromis'NNTP'. Also go read theNNTPAuthLoginandNNTPAuthPasswddescriptions below. ๐ซถNNTPAuthLoginโ a valid NNTP authentication login for your NNTP server. You only need this if your server is being extra and demanding auth.NNTPAuthPasswdโ the password that goes with the login inNNTPAuthLogin. > Heads up: hardcoding this in a script is evil, and there should genuinely be a much better way. ๐ญPeriodโ how long the period is, in days, immediately before the program was invoked, i.e. the window of articles you want scanned. The default is seven (7) days. ๐QuoteREโ a Perl regular expression that accepts quoted lines and rejects unquoted or original lines. The default regex is:
^\s{0,3}(?:"|:|\S+>|\+\+)>
Excludeโ should be a reference to an array holding regular expressions that accept email addresses of posters whose articles you want to ignore. Bye bestie. ๐Aliasesโ should be a reference to a hash whose keys are email addresses that get transformed into the email addresses that are their corresponding values, i.e."alias" = 'real@address'>. ๐
๐ METHODS ๐
configure ( [ OPTIONS ] )
OPTIONS is a list of named parameters, identical to the ones new accepts. Re-configure-ing an object after scanning is probably a bad idea, fr fr. This method returns undef if it hits an error.
The following methods are the actual underlying methods used to set and retrieve the configuration options of the same name (modulo case, obviously):
name ( [ NEWSGROUP-NAME ] )
spool ( [ SPOOL-DIRECTORY ] )
period ( [ INTERVAL-LENGTH ] )
aliases ( [ ALIASES-HASHREF ] )
from ( 'NNTP' | 'spool' )
quote_re ( [ QUOTE-REGEX-ARRAYREF ] )
exclude ( [ EXCLUSION-REGEX-ARRAYREF ] )
nntp_server ( [ [ NNTP-SERVER ]:[ NNTP-PORT ] ] )
nntp_auth_login ( [ LOGIN ] )
nntp_auth_passwd ( [ PASSWORD ] )
These methods are how you pull info out of the News::Scan object or ask it to go do something. โจ
error ( [ MESSAGE ] )
Use this one to figure out whether an object has run into an error condition. The return value of error is guaranteed to be 0 after any method completes successfully (except error itself, sneaky). > Keep in mind this will also overwrite any previous error message. If there has been an error, this method should return some useful message.
If you pass it, MESSAGE sets the object's error message.
articles
Returns the number of articles accounted for. ๐งฎ
volume
Returns the volume of traffic (in bytes) to the newsgroup in the period.
header_volume
Returns the volume (in bytes) generated by headers.
header_lines
Returns the number of lines consumed by headers.
body_volume
Returns the volume (in bytes) generated by message bodies.
body_lines
Returns the number of lines consumed by message bodies.
orig_volume
Returns the volume (in bytes) of text that's been determined to be original (see QuoteRE). > Note that original traffic is a subset of body traffic.
orig_lines
Returns the number of lines determined to be original.
signatures
Returns the number of messages that had a cutline (/^-- $/).
sig_volume
Returns the volume (in bytes) generated by signatures.
sig_lines
Returns the number of lines consumed by signatures.
earliest ( [ TIME ] )
Use this to find the date (in seconds since the Epoch) that the oldest article found within the period was posted to Usenet.
If TIME is given, it's treated as a candidate for the earliest article. If TIME is successful (i.e. it's less than the previous earliest), this method returns 1, else 0. ๐
latest ( [ TIME ] )
Use this to find the date (in seconds since the Epoch) that the youngest article found within the period was posted to Usenet.
If TIME is given, it's treated as a candidate for the latest article. If TIME is successful (i.e. it's greater than the previous latest), this method returns 1, else 0. ๐
excludes
Returns the list of regular expressions used to decide whether an article from a given email address should be ignored.
posters
Returns a reference to a hash whose keys are email addresses and whose values are News::Scan::Poster objects corresponding to those email addresses. See News::Scan::Poster.
threads
Returns a reference to a hash whose keys are subjects and whose values are News::Scan::Thread objects corresponding to those subjects. See News::Scan::Thread.
crossposts
Returns a reference to a hash whose keys are newsgroup names and whose values are the number of times the corresponding groups have been crossposted to.
collect
Use this method to mirror the articles from the specified NNTP server to the specified spool. > Please be kind to the NNTP server. ๐ฅบ
scan
Instruct the object to gather information about the newsgroup. Main character moment. ๐
๐ฆ EXAMPLES ๐ฆ
See the eg/ directory in the News-Scan distribution, available from the CPAN โ http://www.perl.com/CPAN/. ๐
๐ SEE ALSO ๐
perlre, News::Scan::Poster, News::Scan::Thread, News::Scan::Article, Net::NNTP
๐ AUTHOR ๐
Greg Bacon <gbacon@cs.uah.edu>
๐ธ COPYRIGHT ๐ธ
Copyright (c) 1997 Greg Bacon. All Rights Reserved. This library is free software. You may distribute and/or modify it under the same terms as Perl itself.
And that's the whole page, bestie โ this one was perl v5.32.0, dated 2021-01-08, and it's the News::Scan(3pm) manual page. Slay, go scan a newsgroup. ๐โจ๐ฆ
๐ฆ where this page comes from
- debian bookworm: libnews-scan-perl 0.53-4.1 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libnews-scan-perl 0.53-4.1 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libnews-scan-perl 0.53-4.1 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libnews-scan-perl 0.53-4.1 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libnews-scan-perl 0.53-4.1 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libnews-scan-perl 0.53-4.1 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms