From 5a0e8bd89d61afd07dc1eb0120cf02ffaf3d1237 Mon Sep 17 00:00:00 2001 From: Lynne Date: Sat, 8 Sep 2018 23:56:30 +0000 Subject: [PATCH] Added a bunch of custom behaviours --- README.md | 2 +- gen.py | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 27ad571..e4eaff6 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,6 @@ make a bot (probably on bots in space) and follow the target accounts run `python3 main.py` to login and scrape -run `pyhton3 gen.py` to make a toot +run `python3 gen.py` to make a toot cron is an okay choice to make it toot regularly diff --git a/gen.py b/gen.py index 47b12d6..9b42f5c 100644 --- a/gen.py +++ b/gen.py @@ -2,6 +2,7 @@ import markovify import json import time from mastodon import Mastodon +import re, random api_base_url = "https://botsin.space" #todo: this shouldn't be hardcoded @@ -16,8 +17,64 @@ with open("corpus.txt", encoding="utf-8") as fp: print("tooting") sentence = None # you will make that damn sentence -while sentence is None: +while sentence is None or len(sentence) > 500: sentence = model.make_sentence(tries=100000) toot = sentence.replace("\0", "\n") + +if random.randint(1, 10) == 3: + #time for some nonstandard behaviour babey + choice = random.randint(1, 3) + 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"] + prefaces = ["hey", "guess what", "", "special message for", + "telegram for", "bringing this fight to mastodon."] + toot = "{} @lynnesbian@deadinsi.de {}".format( + random.choice(prefaces), random.choice(insults)) + 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", + "transbian", "optimistic", "pessimistic", "quiet", "smart"] + 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", + "great, hit me up ;)"] + toot = "{} girls are {}".format(random.choice(girls), + random.choice(compliments)) + elif choice == 3: + #don't do this one TOO much otherwise it'll get really old + if random.randint(1, 3) == 2: + lesbian = "lesbian" + toot = "".join(random.sample(lesbian, len(lesbian))) + + else: + print ("lynne is still working on me. i'm not done quite yet!") + +prefixes = ["hot take:", "listen up everbody.", "dear liberal snowflakes,", +"IMPORTANT ADMIN ACCOUNCMENT:\n", "my name's lynne and i'm here to say,", +"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:", +"i may be a lowly python script, but", "", "beep boop", "heads up:", +"from now on,", "protip:", "life advice:", "take it from me,", +"as a slime girl,", "as a robot,"] +if random.randint(1, 10) == 3: + #add a prefix + if len(toot) < 500: + #if it's already the maximum length, don't waste our time + toot = "{} {}".format(random.choice(prefixes), toot) + while len(toot) > 500: + #if it's too long, keep trying again + toot = "{} {}".format(random.choice(prefixes), toot) + client.toot(toot) print("Created toot: {}".format(toot))