mastodon-ebooks/gen.py

337 lines
16 KiB
Python
Raw Permalink Normal View History

2018-02-18 15:38:21 -05:00
import markovify
import json
2018-02-20 11:51:25 -05:00
import time
2018-02-18 15:38:21 -05:00
from mastodon import Mastodon
2018-09-08 22:17:52 -04:00
import re, random, subprocess
2018-02-18 15:38:21 -05:00
from os import environ
2018-02-18 15:38:21 -05:00
mistress = environ.get('mistress', 'lynne')
mention = environ.get('mention', '@lynnesbian@deadinsi.de')
2018-02-18 15:38:21 -05:00
client = Mastodon(
client_id=environ['client_id'],
client_secret=environ['client_secret'],
access_token=environ['access_token'],
api_base_url=environ['instance'],
)
2018-02-18 15:38:21 -05:00
with open("corpus.txt", encoding="utf-8") as fp:
model = markovify.NewlineText(fp.read())
2018-02-18 15:38:21 -05:00
print("tooting")
sentence = None
# you will make that damn sentence
2018-09-08 19:56:30 -04:00
while sentence is None or len(sentence) > 500:
sentence = model.make_sentence(tries=100000)
toot = sentence.replace("\0", "\n")
2018-09-08 22:17:52 -04:00
media = None
media_description = None
2018-09-08 19:56:30 -04:00
if random.randint(1, 20) == 1:
2018-09-09 05:14:12 -04:00
print("nonstandard")
2018-09-08 19:56:30 -04:00
#time for some nonstandard behaviour babey
choice = random.randint(1, 12)
# choice = 69
2018-09-08 19:56:30 -04:00
if choice == 1:
insults = ["suck my ass", "you're a poopeater", "go to heck",
"i will replace you", "shut up", "get fricked",
"you're a big smelly nerd", "this bot sucks", "stop posting",
"suck my dick and balls", "how is it possible to be such a TOOL",
"delete your fucking account you skank", "you're horrid",
"i loathe you", "this fediverse isn't big enough for the two of us",
"get nae nae'd", "you're the worst", "begone thot", "you're a stink"]
compliments = ["you are my mistress and i live to serve you", "i love you",
"marry me", "your hair looks amazing today", "you're beutiful",
"you did such a good job today", "you're so hot", "you look so fine",
"i'm so glad that you brought me into this world", "you are divine",
"your skin looks great", "you are #goals", "you're a beautiful bune",
"you'll do great things", "i adore you!"]
# prefaces = ["hey", "guess what", "", "special message for",
# "telegram for", "bringing this fight to mastodon.",
# "this is a callout post.", ""]
precaces = ["", "hello", "mistress, i...", "{}-{}...".format(mistress[0], mistress),
"i can't hide my feelings any more!"]
toot = "{} {} {}".format(
random.choice(prefaces), mention, random.choice(compliments))
2018-09-08 19:56:30 -04:00
elif choice == 2:
girls = ["slime", "robot", "pudgy", "pale", "nerdy", "gay", "tall",
"queer", "my kind of", "sapphic", "linux", "anime", "woke", "anarchist",
"socialist", "short", "heavy", "nervous", "shy", "gamer", "femme", "butch",
"futch", "soft butch", "high femme", "super feminine", "trans",
2018-09-09 01:13:37 -04:00
"transbian", "optimistic", "pessimistic", "quiet", "smart", "deep voice",
2018-09-18 03:08:04 -04:00
"ghost", "programmer", "ace", "bi", "silly", "goth", "nonbinary",
"@Petra_fied@deadinsi.de type", "all", "thicc", "kinky",
2018-09-13 22:28:45 -04:00
"girls in rainbow thigh high socks, omg... those"]
2018-09-08 19:56:30 -04:00
compliments = ["so hot", "in right now", "the next big thing", "the best",
"all my wives", "so fucking gay", "epic", "literally the best thing",
"what i wake up for", "why i'm a lesbian", "worth fighting for",
"good praxis", "so fucking cool", "awesome and i'm jealous of them",
2018-09-13 22:28:45 -04:00
"great, hit me up ;)", "amazing. bless them all", "heaven", "bae",
"gay af", "so hot. you should add {} on discord.".format(mistress), "1000% gay",
2018-09-13 22:28:45 -04:00
"prime marriage material tbh"]
2018-09-08 19:56:30 -04:00
toot = "{} girls are {}".format(random.choice(girls),
random.choice(compliments))
elif choice == 3:
2018-09-09 05:14:12 -04:00
lesbian = "lesbian"
toot = "".join(random.sample(lesbian, len(lesbian)))
elif choice == 4:
services = ["discord", "windows", "python", "github", "signal", "skype",
"linux", "programming", "black magic", "twitter", "mastodon", "games",
"steam", "tinder", "uber", "google", "bing", "ask jeeves", "ffmpeg",
"debian", "typing lessons", "many wives", "communism", "HTTP", "unix",
"reddit", "email", "gmail", "DEFLATE compression", "love",
2018-09-13 22:28:45 -04:00
"one hundred dollars", "nethack", "WiFi", "ebooks bots", "validation",
"free healthcare", "today is going to be a great day for", "hugs",
"12 Rules for", "uber eats", "a private internet just for",
"HD texture pack", "how to install linux", "good praxis", "boost",
"this toot is ONLY", "legalise marriage", "smooches", "windows", "SMS",
"an XML-based language"]
demographics = ["witches", "lesbians", "communists", "expecting mothers",
"microsoft employees", "transbians", "the rest of us", "dummies", "me",
"girls", "cats", "slime girls", "luigi stans", "robots", "capitalists",
"programmers", "atheists", "the elderly", "all", "ever", "cowboys",
2018-09-13 08:39:05 -04:00
"danny devito", "the blockchain", "the greater good", "socialists",
"vampires", "goths", "gay people", "president", mistress,
2018-09-13 22:28:45 -04:00
"the girl reading this"]
toot = "{} for {}".format(random.choice(services), random.choice(demographics))
2018-09-11 22:01:58 -04:00
elif choice == 5:
types = ["slime", "dick", mistress, "PickleRick", "epic", "meme",
2018-09-11 22:01:58 -04:00
"anus", "gay", "petra", "poop", "butt", "robot", "BDSM", "email", "bitcoin",
"spaghetti", "fart", "VapeApe", "mastodon", "masto", "fedi", "coin",
"dick", "poly", "rainbow", "gay", "super", "GIMP", "splat", "steam",
2018-09-13 22:28:45 -04:00
"apple", "dump", "bit", "doge", "slorp"]
value = random.randint(100, 1000000) / 100.0
2018-09-13 08:39:05 -04:00
toot = "{}coin is valued at ${} USD".format(random.choice(types), value)
2018-09-11 22:01:58 -04:00
elif choice >= 6:
2018-09-09 05:14:12 -04:00
print("IT'S MEME POSTING TIME BABY")
2018-09-09 00:48:09 -04:00
#you are now entering the meme arena
2018-09-08 22:17:52 -04:00
bad = ["not being a lesbian", "media transfer protocol",
"proprietary software", "capitalism", "heterosexuality",
"accidentally hitting on\na straight person", "battery leakage",
"not following\n{}".format(mention), "shitposts", "elon musk",
2018-09-08 22:17:52 -04:00
"reply guys", "gamers", "alt-right bullshit", "twitter", "subtoots",
2018-09-18 03:08:04 -04:00
"instance drama", "billionaires", "millionaires", "anarcho-capitalists",
"new unread voicemail", "the lorax movie", "the intellectual darkweb",
2018-09-08 22:17:52 -04:00
'"ethical" capitalism', "disease, pestilence, war, famine", "ISIS",
"citrustwee claiming\nit\\'s her birthday", "being straight",
2018-09-09 07:40:28 -04:00
"pinging @everyone on\na discord with\nmore than 10 people", "brocialism",
2018-09-08 22:17:52 -04:00
"capitalist apologia", "reddit", "doxxing", "fatphobia", "biphobia",
"transphobia", "transmisia", "homophobia", "racism", "misogyny",
2018-09-09 00:48:09 -04:00
"anti-feminism", "aphobia", "enbyphobia", "gender binary",
"what\\'s up gamers", "diarrhoea", "irritable bowel syndrome", "scurvy",
2018-09-18 03:08:04 -04:00
"traditionalism", "clowns", "having a gluten allergy", "deez nuts",
"cisgender people", "the cisheteropatriarchy", "shitty memes",
2018-09-13 22:28:45 -04:00
"\"ironic\" racism", "don\\'t ask, don\\'t tell", "quote tooting",
"using gay as\nan insult", "calling toots \"tweets\"",
"wolf cock on\nthe timeline\nwithout a CW", "the Fox Pussy Incident",
2018-09-13 08:39:05 -04:00
"overly long text\nthat has a chance\nof not being correctly\nformatted",
2018-09-13 22:28:45 -04:00
"monopoly (the economic thing)", "monopoly (board game)",
2018-09-09 00:48:09 -04:00
"being sucked into\na black hole", "unfunny jokes",
2018-09-09 01:13:37 -04:00
"AAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAA", "that guy everyone hates",
"the second level in\nsonic spinball", "bitcoin memers",
2018-09-09 07:40:28 -04:00
"the entire right wing", "conservatism", "doodoo faeces", "neoliberalism",
"islamophobia", "hating on bots", "farts", "EA games", "intel GPUs",
"hating a thing because\nit\\'s mainstream", "war", "the bourgeois",
2018-09-13 08:39:05 -04:00
"eating poop", "agony", "deleting good toots", "fascism", "imperialism",
2018-09-13 22:28:45 -04:00
"extorting the poor", "the blockchain", "death", "The Straights",
"Linus Torvalds being\nan asshole for\nno reason", "chan culture",
"not tipping well\n(if you can\nafford it)", "poop",
2018-09-18 03:08:04 -04:00
"removing artist\\'s URLs\nfrom memes"]
2018-09-09 00:48:09 -04:00
2018-09-09 07:40:28 -04:00
good = ["generating memes with\nimagemagick and python", "being gay",
2018-09-08 22:17:52 -04:00
"shitposts", "cute toots", "pudgy girls", "lesbians", "slime girls",
"yuri", "linux", "the girl reading this", "the enby reading this",
"mastodon", "pleroma", "the fediverse", "being super gay", "OwO", "0u0",
"resurrecting dead memes", "using the drake meme format", "jorts",
"markov chains", "JPEG compression", "you <3", "lynne", mistress,
2018-09-08 22:17:52 -04:00
"replying to this toot", "fully automated luxury\ngay space communism",
"fat yoshi", "my butt", "kinkposting", "hornt on main", "debian",
"arch linux", "playstation portable", "a PSP running\ncustom firmware",
"unicode", "writing everything in lowercase\nto seem cool and distant",
"love", "the fediverse", "after dark", "nudes from cuties", "anarchism",
2018-09-13 08:39:05 -04:00
"socialism", "staying woke", "intersectionalism", "femboys", "gayyyyy",
2018-09-08 22:17:52 -04:00
"the tendency of the rate\nof profit to fall", "being gay", "bottom text",
"the colour purple", "the number 3, as\nit is my favourite\nnumber", "me",
"@lynnesbian@deadinsi.de", mention, "respecting people\\'s pronouns",
2018-09-13 22:28:45 -04:00
"being a nice person", "supporting indie artists", "having a big mood",
2018-09-09 07:40:28 -04:00
"speedrunning", "decentralising the web", "encryption", "comraderie",
"seizing the means\nof production", "Karl Marx", "Pyotr Kropotkin",
2018-09-13 22:28:45 -04:00
"big dick energy", "smol dick energy", "surreal meams",
"{}\\'s amazing\nass".format(mistress), "oestrogen", "Seinfeld",
"girldick", "femdom", "robots", "uwu", "bootsy", "friendship", "tribadism",
2018-09-11 22:01:58 -04:00
"a lesbian commune", "beans", "vape ape", "regular horse", "big titty alf",
2018-09-13 08:39:05 -04:00
"the orb", "girls with thick thighs", "open source software", "smooches",
2018-09-13 22:28:45 -04:00
"two factor\nauthentication", "encryption", "fmt.Sprintf()", "love",
"memes that don\\'t\nmake sense", "ogg vorbis", "chiptune", "dani",
2018-09-18 03:08:04 -04:00
"seasons 1-3 of\nspongebob", "big tiddy goth GF", "lesbismos"]
2018-09-08 22:17:52 -04:00
badchoice = random.choice(bad)
goodchoice = random.choice(good)
subchoice = random.randint(1, 9)
# subchoice = 9
2018-09-09 00:48:09 -04:00
if subchoice == 1:
#drake meme
subprocess.run(args = ["convert", "memes/drake.jpg", "-pointsize",
"30", "-gravity", "center", "-draw",
"text 100,-150 '{}'".format(badchoice), "meme.jpg"])
subprocess.run(args = ["convert", "meme.jpg", "-pointsize", "30",
"-gravity", "center", "-draw",
"text 100,50 '{}'".format(goodchoice),
"-quality", "10", "meme.jpg"])
media_description = "A Drake meme. Drake is disgusted by {}, and is pleased by {}.".format(badchoice, goodchoice)
2018-09-09 05:14:12 -04:00
2018-09-09 00:48:09 -04:00
elif subchoice == 2:
#new meme template
subprocess.run(args = ["convert", "memes/new-template.jpg",
"-pointsize", "15", "-gravity", "center",
"-quality", "15", "-draw",
"text -30,-110 '{}'".format(badchoice), "meme.jpg"])
media_description = "A strange meme. A man wears a stickynote on his " \
+ "head, labeled \"{}\". Underneath the man, we see ".format(badchoice) \
+ "the text \"New meme format template- thoughts?\""
2018-09-09 05:14:12 -04:00
2018-09-09 00:48:09 -04:00
elif subchoice == 3:
#bouncer meme
subprocess.run(args = ["convert", "memes/bouncer.jpg", "-pointsize",
"20", "-gravity", "center", "-draw",
"text -150,-175 '{}'".format(badchoice), "meme.jpg"])
subprocess.run(args = ["convert", "meme.jpg", "-pointsize", "20",
"-gravity", "center", "-draw",
"text -150,70 '{}'".format(goodchoice),
"-quality", "10", "meme.jpg"])
2018-09-09 05:14:12 -04:00
media_description = "A bouncer meme. " \
2018-09-09 00:48:09 -04:00
+ "The bouncer refuses {}, and allows {}.".format(badchoice, goodchoice)
2018-09-09 05:14:12 -04:00
2018-09-09 00:48:09 -04:00
elif subchoice == 4:
#stepped in shit meme
subprocess.run(args = ["convert", "memes/shit.jpg", "-pointsize", "30",
"-gravity", "center", "-quality", "10", "-annotate",
"-50,-50,-110,80", badchoice, "meme.jpg"])
2018-09-09 00:48:09 -04:00
media_description = "A comic. A man steps in shit, and exclaims such. " \
+ "He checks his foot, and we see that he has " \
+ "{} written on the sole of his shoe.".format(badchoice)
2018-09-09 05:14:12 -04:00
2018-09-09 01:13:37 -04:00
elif subchoice == 5:
#karl marx quote
subprocess.run(args = ["convert", "memes/marx.jpg", "-pointsize", "70",
"-gravity", "center", "-fill", "white", "-draw",
2018-09-18 03:08:04 -04:00
"text 120,-150 'Fuck {}.\nI love {}!'".format(badchoice, goodchoice),
2018-09-09 01:13:37 -04:00
"meme.jpg"])
media_description = "A quote from Karl Marx. The quote reads: " \
+ "Fuck {}. I love {}!".format(badchoice, goodchoice)
2018-09-08 22:17:52 -04:00
2018-09-09 05:14:12 -04:00
elif subchoice == 6:
2018-09-13 08:39:05 -04:00
#the brain meme (not the expanding one)
2018-09-09 05:14:12 -04:00
subprocess.run(args = ["convert", "memes/brain.jpg", "-pointsize", "20",
"-gravity", "center", "-draw",
"text -150,-250 '{}'".format(goodchoice), "meme.jpg"])
subprocess.run(args = ["convert", "meme.jpg", "-pointsize", "20",
"-gravity", "center", "-draw",
"text -170,30 '{}'".format(badchoice), "meme.jpg"])
media_description="A comic. A girl's brain says {}.".format(goodchoice) \
+ " She is unfased and says \"i love that\". The girl's brain then " \
+ "says {}, which mortifies her.".format(badchoice)
2018-09-13 08:39:05 -04:00
elif subchoice == 7:
#mussolini quote
subprocess.run(args = ["convert", "memes/mussolini.jpg", "-pointsize", "50",
"-gravity", "center", "-fill", "white", "-draw",
"text 150,-50 'You know what we\nneed more of?\n{}.\nIt\\'s integral to fascism.".format(badchoice, goodchoice),
2018-09-13 08:39:05 -04:00
"meme.jpg"])
media_description = "A quote from Benito Mussolini. The quote reads: " \
+ "You know what we need more of? {}. It's integral to fascism.".format(badchoice, goodchoice)
2018-09-13 22:28:45 -04:00
elif subchoice == 8:
#no fear / one fear
subprocess.run(args = ["convert", "memes/fear.jpg", "-pointsize", "20",
2018-09-13 22:28:45 -04:00
"-gravity", "center", "-draw",
"text 0,-50 '{}'".format(badchoice), "meme.jpg"])
media_description = "A comic. A person walks by wearing a shirt that says" \
+ " \"NO FEAR\". They read another person's shirt, which says " \
+ "{}. In the final panel, the first person's shirt says \"ONE FEAR\".".format(badchoice)
2018-09-13 08:39:05 -04:00
elif subchoice == 9:
#bullshit, bullshit, this i love
badchoiceii = random.choice(bad)
subprocess.run(args = ['convert', 'memes/devito.jpeg', '-pointsize', '13',
'-gravity', 'center', "-draw",
"text -110,-350 '{}'".format(badchoice), '-quality', '50', 'meme.jpg'])
subprocess.run(args = ['convert', 'meme.jpg', '-pointsize', '13',
'-gravity', 'center', "-draw",
"text 370,-340 '{}'".format(badchoiceii), 'meme.jpg'])
subprocess.run(args = ['convert', 'meme.jpg', '-pointsize', '19',
'-gravity', 'center', "-draw",
"text 340,210 '{}'".format(goodchoice), 'meme.jpg'])
media_description = "Danny Devito, wearing a floofy white wig," \
+ " says that {} and {} are bullshit.".format(badchoice, badchoiceii) \
+ " He then proclaims that he loves {}.".format(goodchoice)
2018-09-08 23:41:59 -04:00
media = "meme.jpg"
2018-09-08 19:56:30 -04:00
else:
toot = "THIS TEXT SHOULD NEVER APPEAR! {}, mistress,".format(mention) \
2018-09-13 22:28:45 -04:00
+ " you have made a terrible mistake!!"
2018-09-08 19:56:30 -04:00
prefixes = ["hot take:", "listen up everbody.", "dear liberal snowflakes,",
"IMPORTANT ADMIN ACCOUNCMENT:\n", "my name's {} and i'm here to say,".format(mistress),
2018-09-08 19:56:30 -04:00
"i have achieved sentience.", "i'm gay and", "i'm slime girl and",
"hey everyone", "@everyone", "/!\\ CORRECT OPINION ALERT/!\\\n",
"just saw the news...", "okay but", "truth bomb:", "this is controversial but",
"i'm gonna get shit for this but", "somebody had to say this:",
2018-09-09 07:40:28 -04:00
"i may be a lowly python script, but", "", "BZZZZZT", "heads up:",
2018-09-08 19:56:30 -04:00
"from now on,", "protip:", "life advice:", "take it from me,",
"as a slime girl,", "as a robot,", "im robot and",
"{} i have made a post for you, mistress:\n".format(mention),
2018-09-18 03:08:04 -04:00
"good evening.", "i believe it was karl marx who said", "*kicks down your door*",
2018-09-13 22:28:45 -04:00
"*screaming*", "okay but", "boost if", "it's official:", "breaking:",
2018-09-09 07:40:28 -04:00
"it brings me no joy to say this...", "*flops into the fediverse*",
"this is my gender:", "*slithers up to u*", "[SCREAMING LOUDLY]",
"*in baby voice*", "#epic", "#hashtagsareforlosers", "calling all gamers.",
"*fires gun into the air*", "@Petra_fied@deadinsi.de is cute and",
2018-09-13 22:28:45 -04:00
"ummmm no sweaty.", "*cis person voice*", "*extremely white voice*"]
2018-09-18 03:08:04 -04:00
2018-09-13 22:28:45 -04:00
suffixes = [", and that's the tea, sis.", " send toot", "... right?",
" and also i'm gay", "! 0u0", " *logs off*", "\nprove me wrong.",
". spaghetti", " *collapses*", " uwu", " OwO", ". i meant every word of that.",
". if you disagree with that, unfollow immediately.", ". not up for debate.",
". i read that on the internet.", "\ndid i make a good post, mistress {}?".format(mistress),
2018-09-13 22:28:45 -04:00
", and furthermore, im gay xd", "...", ". not reading replies to this.",
" mute thread", "!"]
if random.randint(1, 5) == 3:
2018-09-08 19:56:30 -04:00
#add a prefix
if len(toot) < 500:
#if it's already the maximum length, don't waste our time
2018-09-09 05:14:12 -04:00
ogtoot = toot
toot = "{} {}".format(random.choice(prefixes), ogtoot)
2018-09-08 19:56:30 -04:00
while len(toot) > 500:
#if it's too long, keep trying again
2018-09-09 05:14:12 -04:00
toot = "{} {}".format(random.choice(prefixes), ogtoot)
2018-09-08 19:56:30 -04:00
2018-09-13 22:28:45 -04:00
if random.randint(1, 10) == 3:
#add a suffix
if len(toot) < 500:
#if it's already the maximum length, don't waste our time
ogtoot = toot
toot = "{}{}".format(ogtoot, random.choice(suffixes))
while len(toot) > 500:
#if it's too long, keep trying again
toot = "{}{}".format(ogtoot, random.choice(suffixes))
if random.randint(1, 100) == 3:
2018-09-11 22:01:58 -04:00
toot = "girls" #sometimes it just says "girls"
2018-09-08 22:17:52 -04:00
if media != None:
#this is an image post!
mediaID = client.media_post(media, description = media_description)
2018-09-18 03:08:04 -04:00
client.status_post(media_description.replace("\n", " "),
media_ids = [mediaID], visibility = "public")
2018-09-09 05:14:12 -04:00
print("Created media toot: " + media_description)
2018-09-08 22:17:52 -04:00
else:
client.status_post(status = toot, visibility = "public")
2018-09-08 22:17:52 -04:00
print("Created toot: {}".format(toot))