mirror of
https://git.wownero.com/lza_menace/suchwow.git
synced 2024-08-15 01:03:19 +00:00
add cli command to post to reddit for last x hours
This commit is contained in:
parent
490082cc09
commit
307d189967
1 changed files with 12 additions and 0 deletions
|
@ -91,6 +91,18 @@ def init():
|
||||||
# init db
|
# init db
|
||||||
db.create_tables([Post, Profile, Comment, Notification, Moderator])
|
db.create_tables([Post, Profile, Comment, Notification, Moderator])
|
||||||
|
|
||||||
|
@app.cli.command("post_reddit")
|
||||||
|
@click.argument('last_hours')
|
||||||
|
def post_reddit(last_hours):
|
||||||
|
posts = Post.select().where(
|
||||||
|
Post.approved==True,
|
||||||
|
Post.to_reddit==False
|
||||||
|
).order_by(Post.timestamp.asc())
|
||||||
|
for p in posts:
|
||||||
|
if p.hours_elapsed() < int(last_hours):
|
||||||
|
make_post(p)
|
||||||
|
return
|
||||||
|
|
||||||
@app.cli.command("create_accounts")
|
@app.cli.command("create_accounts")
|
||||||
def create_accounts():
|
def create_accounts():
|
||||||
wallet = wownero.Wallet()
|
wallet = wownero.Wallet()
|
||||||
|
|
Loading…
Reference in a new issue