Unix Review > Archives > 2004 > August 2004

August 2004

Shell Corner: analyze-postings — A Shell Script to Analyze Netnews Postings

Hosted by Ed Schaefer

analyze-postings
by Dave Taylor

Listing 1: analyse-nttp.sh

As an instructor for the University of Phoenix Online, I not only work with Netnews groups for my personal interests, but professionally, too. While itęs not hard to find a Netnews reader (most email programs seem to include NNTP compatibility nowadays), itęs not very easy to do any sort of analysis of news postings, which is exactly what I need to do for my classes.

I need to be able to calculate two things: total number of postings in a given period of time, and number of days during that period that there were postings. For example, if we talked about the first week of September, thatęs a 7-day period, during which time a given student could post an arbitrary number of articles on any of 0-7 days.

Half the Solution with "suck"

The first part of my solution utilizes a nifty, albeit somewhat old, open source application with the melodious name of ęsuckę. You can find this application at http://www.sucknews.org/. It's easy and quick to download, configure, and install. Use the README file to get started.

Once installed, I had to figure out how to get the application to download postings but not save them on the disk since it was the data stream I wanted to analyze, not save (the postings are saved on the server). After some experimentation, I figured out that I could specify the account name, password, and server name:

suck nntp.sampleu.edu -U taylor -P 'myPassWord' ęg
The "-g" flag forces suck to only download headers, which saves oodles of time.

Sys Admin Spotlight

CMP DevNet Spotlight

Regular Expressions: Two Easy Steps Better Than One Hard One
Complicated regular expressions and yacc are powerful parsing tools, but they can cause trouble in inexperienced hands. One helpful alternative is "partial evaluation" (PE) or "active data" parsing

In the News

CD-ROM

Sys Admin and The Perl Journal CD-ROM version 11.0

Version 11.0 delivers every issue of Sys Admin from 1992 through 2005 and every issue of The Perl Journal from 1996-2002 in one convenient CD-ROM!

Order now!




MarketPlace

Build IT Knowledge with Current & Trusted Content
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.

Six Sigma Certification
100% Online-Six Sigma Certificate from Villanova - Find Out More Now.

Flowcharts from C/C++ code -- Free trial download
Understand C/C++ code in less time. A new team member ? Inherited legacy code ? Get up to speed faster with Crystal Flow for C/C++. Code-formatting improves readability. Flowcharts are integrated with code browser. Export flowcharts to Visio.

Discover WinDev 11 RAD
and develop 10 times faster ! ALM, IDE, .Net, PDF, 5GL, Database, 64-bit, etc. Free Express version

Wanna see your ad here?