#!/usr/bin/python # $Id:$ import time, string, sys import nntplib #f = open(sys.argv[1]) f = sys.stdin s = nntplib.NNTP('news.karelia.ru') #s.set_debuglevel(31) print s.post(f) print s.quit() time.sleep(5) s = nntplib.NNTP('news.karelia.ru') resp, count, first, last, name = s.group('relcom.test') print first, last resp, subs = s.xhdr('subject', first + '-' + last) for id, sub in subs[-10:]: print id, sub print s.quit() # End of post.py