#!/usr/bin/env            python3
#               torsocks

import nntplib
s    = nntplib.NNTP(         'news.samoylyk.net')
hh   = nntplib.decode_header("=?ISO-8859-15?Q?D=E9buter_Py?=")
print(hh)

#resp, count, first, last, name = s.group( 'free.willey')
#print(                            'Group', name,         'has', count, 
'articles, range', first, 'to', last)

#resp,                 overviews = s.over((last - 3, last))
#for       id, over in overviews:
#   pass
#   print(id, nntplib.decode_header(over['subject']))                      #    
                                        comp.lang.python.narkive.com.

x =        f = open('usenet_post.txt', 'rb')       # all relevant headers set   
        groups.google.com/forum/#!forum/comp.lang.python
e = s.post(f)

#resp,          descs = s.descriptions('alt.*')
#print   (  len(descs)                        )
#print   (      descs.popitem()               )     # 
'alt.zzzz.fred-hall-is-a-piece-of-shit', 'Fred Hall is a piece of shit'

s.quit()
'''
                the file   usenet_post.txt     with these headers originally:

Path:
From: aa <a...@aa.aa>
Subject: self - hosted usenet poster with python
Newsgroups: comp.lang.python
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=utf-8
Date: Mon, 13 Jan 2020 01:00:00 GMT
Lines: 25
Organization: pythonista.org
X-Newsreader: python 3
X-No-Archive: no
X-User-Key:   py
X-User-Signature: python spam now comes to comp lang py as well

'''
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to