iawefhoawiefhoweai

This commit is contained in:
Luke Ogburn
2022-04-20 23:35:15 -04:00
parent 58de863412
commit 3c3acdee0b
2 changed files with 22 additions and 8 deletions

View File

@@ -14,16 +14,29 @@ def run(masto, service):
service.keep_lively()
def main():
# get config
config = json.load(open('config.json', 'r'))
# get settings if applicable
neuter = False
wait = 5
try:
c = config["autotoot"]
if "neuter" in c:
neuter = c["neuter"].lower() == "true"
if "wait" in c:
wait = int(c["wait"])
except:
pass
print(neuter, wait)
# make bots
masto = bot(config, neuter=neuter)
reddit = scraper("reddit", config, neuter=neuter)
# run bots forever
while True:
# get config
config = json.load(open('config.json', 'r'))
# make bots
masto = bot(config)
reddit = scraper("reddit", config)
# run bots
run(masto, reddit)
# buffer time bc posts only happen so often so why check
time.sleep(5)
time.sleep(wait)
if __name__ == "__main__":
main()

View File

@@ -38,6 +38,7 @@ class reddit_scraper:
def scrape_all(self, limit):
subposts = {}
for place in self.places:
print(place)
subposts[place] = self.scrape(place, limit)
return subposts