removed print statements
This commit is contained in:
28
autotoot.py
28
autotoot.py
@@ -3,42 +3,14 @@ from scraper import scraper
|
|||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
|
|
||||||
'''
|
|
||||||
TODO:
|
|
||||||
done:
|
|
||||||
- [x] Download and posting of video files
|
|
||||||
- [x] Make sure text-only reddit posts work
|
|
||||||
- [x] Eternal looping, run script every 5 mins or something
|
|
||||||
- [x] Different masto post structures for different post types (videos need links)
|
|
||||||
- [x] Import bot/scraper settings from file for automation
|
|
||||||
- [x] Random post if low activity
|
|
||||||
|
|
||||||
likely:
|
|
||||||
- […] Keep track of what has been scraped and tooted to not duplicate posts
|
|
||||||
- […] Separate methdos methods to make code cleaner
|
|
||||||
- […] Debugging logging
|
|
||||||
- [ ] Move all vars into config
|
|
||||||
- [ ] Docker image
|
|
||||||
|
|
||||||
unlikely:
|
|
||||||
- [ ] Updating from @mention toot
|
|
||||||
- [ ] Make this an installable (pip?) package
|
|
||||||
- [ ] Add twitter bot
|
|
||||||
'''
|
|
||||||
|
|
||||||
def run(masto, service):
|
def run(masto, service):
|
||||||
# post any new posts, up to limit
|
# post any new posts, up to limit
|
||||||
print("Scraping")
|
|
||||||
subs = service.scrape_all()
|
subs = service.scrape_all()
|
||||||
print("Tooting if necessary")
|
|
||||||
for sub in subs:
|
for sub in subs:
|
||||||
print(f" Tooting {sub}")
|
|
||||||
service.toot_posts(masto, subs[sub])
|
service.toot_posts(masto, subs[sub])
|
||||||
print("Remembering")
|
|
||||||
service.remember()
|
service.remember()
|
||||||
|
|
||||||
# post random if it has been a while
|
# post random if it has been a while
|
||||||
print("Keeping lively")
|
|
||||||
service.keep_lively()
|
service.keep_lively()
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
Reference in New Issue
Block a user