Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

The New Alt.Magick Archive

11 views
Skip to first unread message

Doomsday Clock

unread,
Aug 31, 2021, 1:30:03 PM8/31/21
to
I'm working on archiving all of the posts from alt.magick since 2003. The
project is online here: https://github.com/powercrypt/Usenet-Archiving-Tool

I will keep everyone updated here as the project evolves, and make the
archive available online through my website. I have organized all of the
posts by author instead of current threads & subjects.

The source code is simple python but it may may format better on github
than here:

#!/usr/bin/python
# Copyright (c) 2021 Corey White

import nntplib
import string
import re

group = "alt.magick"
# connect to server
server = nntplib.NNTP('news.fastusenet.org', user='', password='')
resp, count, first, last, name = server.group(group)
posts = str( int(last) - int(first) + 1)
print("\nThere are %s posts on %s\n" % (posts, group))
print("Getting ready...")
resp, items = server.xover("1", posts)
print("Downloading!")
cnt = 0
for id, subject, author, date, message_id, references, size, lines in
items:
try:
sender = author
resp, id, message_id, text = server.body(id)
author = re.sub('\"', '', author)
author = re.sub('/', '', author)
author = re.sub(r'\<..*',"", author)
author = re.sub(r'@..*',"", author)
author = author.strip()
file = open(author, 'a')
file.write("\n")
file.write("From: %s\n" % (sender))
file.write("Date: %s\n" % (date))
file.write("Subject: %s\n\n" % (subject))
for posted in text:
file.write(posted)
file.write("\n")
print cnt, "articles saved."
cnt = cnt + 1;
except:
print("Retrying...")

file.write("\n")

print ("\n Done.")
server.quit()

Doomsday Clock

unread,
Sep 2, 2021, 5:46:03 AM9/2/21
to
I've finished this python script now. The following will download the
last 100 messages posted to alt.magick. Just change the variable to
download more or less. I'm running this now, downloading all articles
since 2003 and will upload the db shortly.

#!/usr/bin/python
# Copyright (c) 2021 Corey White

import nntplib
import string
import re

group = "alt.magick"
# connect to server
s = nntplib.NNTP('news.fastusenet.org', user=' ', password=' ')
resp, count, first, last, name = s.group('alt.magick')
print('Group', name, 'has', count, 'articles, range', first, 'to', last)
resp, user = s.xhdr('from', str(int(last) - 100) + '-' + last)
for id, nick in user:
author = re.sub('/', '', nick)
author = re.sub('\"', '', author)
author = re.sub(r'\<..*',"", author)
author = re.sub(r'@..*',"", author)
author = author.strip()
if len(author) > 3 and len(author) < 15:
file = open(author, 'a')
file.write("\n")
file.write("From: %s\n" % nick)
r, n, id2, headers = s.head(id)
for item in headers:
x = re.search("Subject", item)
if x:
file.write("%s\n" % item)
x = re.search("Date", item)
if x:
y = re.search("Injection-Date", item)
if not y:
file.write("Date: %s\n" % item)
file.write("\n")
try:
resp2, num2, id2, list = s.body(id)
for line in list:
file.write(line[:80])
file.write("\n")
except:
file.write("error...\n")
file.write("\n")
file.close()
print(id)

print ("\n Done.")
s.quit()
0 new messages