Check in initial version w/o Twitter

This commit is contained in:
Kumi 2018-08-11 10:22:08 +02:00
commit 3cca692dfe
5 changed files with 34 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
**/__pycache__
**/*.swp

20
bot.py Executable file
View file

@ -0,0 +1,20 @@
#!/usr/bin/env python3
import random
def runner():
print(forge)
def percentage():
return random.randint(0, 100)
def readfiles(file1 = "part1.txt", file2 = "part2.txt", file3 = "part3.txt"):
for f in (file1, file2, file3):
with open(f) as o:
yield o.readlines()
def forge():
pa, pb, pc = (random.choice(i).strip() for i in readfiles())
return "%i%% %s %s %s" % (percentage(), pa, pb, pc)

4
part1.txt Normal file
View file

@ -0,0 +1,4 @@
der Befragten
der Österreicher
der niederösterreichischen Bananenbauern

5
part2.txt Normal file
View file

@ -0,0 +1,5 @@
sind dafür, dass
sind dagegen, dass
befürchten, dass
freuen sich darauf, dass
hoffen, dass

3
part3.txt Normal file
View file

@ -0,0 +1,3 @@
Sebastian Kurz und Heinz-Christian Strache heiraten
Adolf Hitler aus dem Inneren der Hohlerde zurückkehrt
Helene Fischer beim Frequency Festival auftritt