Linux Magazine: Perl of Wisdom: Moving Your News Service | Linux Today

Linux Magazine: Perl of Wisdom: Moving Your News Service

Written By
Web Webster
Web Webster
Aug 30, 2000

[ Thanks to Robert
McMillan
for this link. ]

“Several months ago in this space, I talked about how my ISP was
looking at the performance of their news server. I wrote a program
to see just how bad the news service was compared to the other
local ISPs, using Deja as a baseline. Well, the ISP just got bought
out by a big national chain. They decided not to fight the spotty
news service any more and just convert over to the conglomerate’s
big service. The problem with moving from one news server to
another is that the article numbers are not in sync, so a .newsrc
file will have the right newsgroups but the wrong “read” marks. And
since I read a lot of newsgroups, I don’t have time to reread
existing articles, and I don’t want to just throw away any new
articles.”

The solution is a bit complicated and requires extensive
bookkeeping, but that’s what computers are for, and Perl in
particular.
What you need to do is mark as read any articles
you’ve already seen. Messages are uniquely identified by a message
ID, and you can get that mapped into article numbers via the
appropriate XHDR request to the NNTP server.”

“So, basically, for every subscribed newsgroup, we fetch the
message IDs of the last 500 articles from the new server (500 being
the maximum number of unread articles per group I’d care to face).
Then, we fetch the last 1,500 or so message IDs from the old
server. Then, for every message ID on the new server, if I’ve
already read it on the old server, mark it as read in the new
newsrc.”

Complete
Story

Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.