Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Avoid the Gates of Hell. Use Linux -- unknown source


devel / comp.lang.python / post.py

SubjectAuthor
o post.py<Testing

1
post.py

<sfbvin$n7h$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=14621&group=comp.lang.python#14621

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!aioe.org!iTatsX0wzrISZqrWjNJpEg.user.46.165.242.75.POSTED!not-for-mail
From:
Newsgroups: comp.lang.python
Subject: post.py
Date: Sun, 15 Aug 2021 21:05:27 -0000 (UTC)
Organization: Python Pirates
Message-ID: <sfbvin$n7h$1@gioia.aioe.org>
Injection-Info: gioia.aioe.org; logging-data="23793"; posting-host="iTatsX0wzrISZqrWjNJpEg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Python3
X-Notice: Filtered by postfilter v. 0.9.2
 by: - Sun, 15 Aug 2021 21:05 UTC

Just got done writing this nice little posting script. Its my first python script ecer
so be nice lol.

#!/usr/bin/python3
import nntplib
import sys

NAME = 'testbunny'
EMAIL = 'testy@test.com'
SIG = 'Testbunny'
ORG = 'Python Pirates'
SERVER = 'nntp.aioe.org'
GROUPS = 'alt.test'

SUBJECT = input("What is the subject? ")

print("Enter/Paste your content. Ctrl-D or Ctrl-Z ( windows ) to save it.")
contents = []
while True:
try:
BODY = input()
contents.append(BODY)
except EOFError:
break

text = '\n'.join(contents)

open('article.txt', 'w').close()

with open('article.txt', 'a') as f:
f.write('From: ' + NAME + " <" + EMAIL + ">")
f.write("\n")
f.write('Subject: ' + SUBJECT)
f.write("\n")
f.write('Newsgroups: ' + GROUPS)
f.write("\n")
f.write('Organization: ' + ORG)
f.write("\n")
f.write('User-Agent: Python3')
f.write("\n")
f.write("\n")
f.writelines(text)
f.write("\n")
f.write("\n")
f.write('--')
f.write("\n")
f.write(SIG)
f.write("\n")
f.write('.')
print("Sending article....")

s = nntplib.NNTP(SERVER)
f = open('article.txt', 'rb')
s.post(f)
print("done")
s.quit()

--
Python Test Script
..

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor