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

Update: Alt.Magick Archive

28 views
Skip to first unread message

Corey White

unread,
Sep 2, 2021, 3:50:09 PM9/2/21
to
I ran out of bandwidth testing this project on a commercial newsgroup server. It seems that there is some error in part of the alt.magick database when I go back to far. However this final version of the code works great on the free Eternal September server. I think I found a way to format this code on usenet/google but its a bit of a hack. References to all the sources are included here as well:

>#!/usr/bin/python
># Copyright (c) 2021 Corey White
># Web Archive: https://www.merlinimagic.com/alt-magick/
># Zipped Archive: https://www.merlinimagic.com/alt-magick/alt-magick.zip
># Source Code: https://github.com/powercrypt/Usenet-Archiving-Tool
># Replace all > characters at the start of every line with a space or tab.
>
>import nntplib
>import string
>import re
>
>s = nntplib.NNTP('news.eternal-september.org', user='user', password='pass')
>resp, count, first, last, name = s.group('alt.magick')
>print('Group', name, 'has', count, 'articles, range', first, 'to', last)
>cnt = int(last)
>while cnt >= int(first):
>>resp2, num2, id2, list = s.body(str(cnt))
>>r, n, id3, headers = s.head(id2)
>
>>for item in headers:
>
>>>x = re.search("From", item)
>>>if x:
>>>>#print("%s\n" % item)
>>>>global author
>>>>author = re.sub(r'\<..*',"", item)
>>>>author = re.sub(r'@..*',"", author)
>>>>author = author.strip()
>>>>file = open(author[6:], 'a')
>>>>file.write("\n")
>>>>file.write("%s\n\n" % item)
>>>>file.close()
>
>>>x = re.search("Subject", item)
>>>if x:
>>>>#print("%s\n" % item)
>>>>global author
>>>>file = open(author[6:], 'a')
>>>>file.write("%s\n\n" % item)
>>>>file.close()
>
>>>x = re.search("Date", item)
>>>if x:
>>>>#print("%s\n" % item)
>>>>global author
>>>>file = open(author[6:], 'a')
>>>>file.write("%s\n\n" % item)
>>>>file.close()
>
>>for line in list:
>>>#print(line[:80])
>>>#print("\n")
>>>global author
>>>file = open(author[6:], 'a')
>>>file.write(line[:80])
>>>file.write("\n")
>
>>print("%s" % str(cnt))
>>cnt = cnt - 1
>>file.close()
>
>print ("\n Done.")
>s.quit()
0 new messages