From 1845c7105ba2b5c9751a8cd7eb54fbb3ccae1a0a Mon Sep 17 00:00:00 2001 From: sose Date: Sun, 2 May 2021 04:09:49 +0000 Subject: [PATCH] fixed everything --- action_offset | 2 +- bad_words | 32 ++++++++++++++++++++++++++++++++ food_item_offset | 2 +- good_words | 32 -------------------------------- mcsb.py | 22 ++++++++++++++++------ more_words.py | 2 +- 6 files changed, 51 insertions(+), 41 deletions(-) diff --git a/action_offset b/action_offset index 573541a..f11c82a 100644 --- a/action_offset +++ b/action_offset @@ -1 +1 @@ -0 +9 \ No newline at end of file diff --git a/bad_words b/bad_words index e69de29..47bac6f 100644 --- a/bad_words +++ b/bad_words @@ -0,0 +1,32 @@ +debate +fax +fascism +art +disgust +authority +volunteering +swan's-down +platina +baba ghanoush +alpha taxonomy +cabinet making +harikari +sulphurous acid +nausea +base +stock +divining +wee +immunisation +honor +magick +scrolling +dick +fire +guacamole +compare +flatus +goss +draughts +body +autostop diff --git a/food_item_offset b/food_item_offset index 573541a..f11c82a 100644 --- a/food_item_offset +++ b/food_item_offset @@ -1 +1 @@ -0 +9 \ No newline at end of file diff --git a/good_words b/good_words index d14e546..50950f8 100644 --- a/good_words +++ b/good_words @@ -23,10 +23,7 @@ name-dropping hying necking copper -fascism -goss head -guacamole auburn rhubarb rhubarb rhubarb aethyr @@ -70,25 +67,21 @@ het beer outgassing cunt -dick priestesshood channa dahl wiretapping velocity technology solomongundy -disgust balderdash bullshit lead racewalking -fire feed sea-sickness bussing busing handy-dandy -cabinet making asafetida chutzpa gas @@ -104,7 +97,6 @@ science gallows humour jerk grammar -harikari overwintering camelcase cutch @@ -120,7 +112,6 @@ translation radar existence air -art string change hara-kiri @@ -145,13 +136,10 @@ hamburger tom ocean pasta -fax raj -honor plaster imprinting railroading -compare nano media data @@ -160,12 +148,10 @@ beef sag quicksilvering paralinguistics -stock war counseling Chinese boot -body sleep interest wind @@ -179,7 +165,6 @@ nature shit bronze pull -volunteering note information neon @@ -229,7 +214,6 @@ satellite cargo slap beseeming -platina poppycock work first @@ -245,7 +229,6 @@ sulphation coat draining want -divining ruin rook pop @@ -271,7 +254,6 @@ graham muff-diving silence oregano -autostop smoking prestige slip @@ -301,7 +283,6 @@ leukæmia difference leucaemia leucæmia -authority power pig logic @@ -314,7 +295,6 @@ liquor cruor cannabis cunnilingus -flatus valor cassia government @@ -323,8 +303,6 @@ Greek gobbledygook voice mail d-amphetamine -alpha taxonomy -wee pasteurization type waste @@ -380,19 +358,16 @@ character odium opium terror -baba ghanoush onyx inertia imperium unemployment metadata pollen -immunisation collation spalt yerba buena seventh heaven -magick ahinsa tick-tack-toe tee ball @@ -406,21 +381,16 @@ pizza scanability chance balance -base single-phasing rigamarole scampering propaganda -debate -swan's-down swan's down cross talk imperative freethought conching micronization -draughts -scrolling pain pot suicide @@ -438,7 +408,6 @@ trahison ronde balsamico macchia -nausea bile anemia neu @@ -486,7 +455,6 @@ kalium jujutsu hyponatraemia thiosulphuric acid -sulphurous acid sod slop fervor diff --git a/mcsb.py b/mcsb.py index 1327a56..ab39913 100755 --- a/mcsb.py +++ b/mcsb.py @@ -1,10 +1,12 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import requests import time import json import pint import random from typing import Optional +from mastodon import Mastodon + ureg = pint.UnitRegistry() max_food_weight = 100000 # in mg max_food_length = 1000 # in mm @@ -36,6 +38,14 @@ mastodon = Mastodon( api_base_url = 'https://botsin.space' ) +def sleep(seconds): + for i in range(seconds): + try: + time.sleep(1) + except KeyboardInterrupt: + print("killed") + break + def get_more_words(): # we're doing these 500 at a time so we can get some semblance of # randomness @@ -121,11 +131,12 @@ def get_a_food_action(): amount = random.randrange(1, max_food_length) * ureg.millimeter amount = amount.to(ureg("".join(unit.strip().split()[1]))) + amount = ureg.Quantity(round(amount.m, 2), amount.u) with open("./food_item_offset", "w") as food_item_offset_file: food_item_offset_file.write(str(int(food_item_offset) + 1)) - return("eating " + str(amount).replace("_", " ") + "s of " + food_item) + return("eating a " + str(amount).replace("_", " ") + " " + food_item) def get_an_action(): action_offset: str @@ -248,7 +259,6 @@ def get_a_noun(): word = word.strip() print("chose " + word) return word -print(get_a_noun()) while True: random_number: int = random.randint(0, 2) @@ -260,14 +270,14 @@ while True: noun1 = get_a_noun() noun2 = get_a_noun() mastodon.toot(meme.format(action, noun1, noun2)) - print("tooted " + meme.format(action, noun1, noun2)) + print("tooted " + meme.format(action, noun1, noun2).lower()) elif random_number == 1: action = get_a_food_action() if action is None: continue noun1 = get_a_noun() noun2 = get_a_noun() - mastodon.toot(meme.format(action, noun1, noun2)) + mastodon.toot(meme.format(action, noun1, noun2).lower()) print("tooted " + meme.format(action, noun1, noun2)) - time.sleep(2600) + sleep(43200) # toot twice a day diff --git a/more_words.py b/more_words.py index 4601f7f..0478c3e 100755 --- a/more_words.py +++ b/more_words.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import requests import json def get_more_words():