# shitposter.py # Requirements : Toot https://github.com/ihabunek/toot and a Unix-like system import urllib.request import random import subprocess word_url = "http://svnweb.freebsd.org/csrg/share/dict/words?view=co&content-type=text/plain" response = urllib.request.urlopen(word_url) long_txt = response.read().decode() words_online = long_txt.splitlines() words_local = open('/etc/dictionaries-common/words').readlines() toot = '' for i in range (random.randint(0,15)): for j in range (random.randint(0,6)): if j%2==0: toot += random.choice(words_online) else: toot += random.choice(words_local) toot += ' ' toot=toot.replace('\n', ' ') subprocess.call('toot post "{post}"'.format(post=toot), shell=True)