added __main__ stuff
This commit is contained in:
parent
df1e73d271
commit
d7f9a309b1
2 changed files with 6 additions and 3 deletions
4
run.py
4
run.py
|
@ -32,7 +32,7 @@ for row in dc.fetchall():
|
||||||
client = Mastodon(client_id=row['client_id'], client_secret=row['client_secret'], access_token=row['secret'], api_base_url=row['instance'])
|
client = Mastodon(client_id=row['client_id'], client_secret=row['client_secret'], access_token=row['secret'], api_base_url=row['instance'])
|
||||||
for post in j['posts']:
|
for post in j['posts']:
|
||||||
if post['senderData']['id'] == False:
|
if post['senderData']['id'] == False:
|
||||||
sender = "Anonymous user"
|
sender = "(anonymous)"
|
||||||
else:
|
else:
|
||||||
sender = post['senderData']['username']
|
sender = post['senderData']['username']
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ for row in dc.fetchall():
|
||||||
#this is the one we've already seen
|
#this is the one we've already seen
|
||||||
continue
|
continue
|
||||||
|
|
||||||
toot = "Curious cat question from {}: \"{}\"\nMy answer: {}\nView online at https://curiouscat.me/{}/post/{}".format(sender, post['comment'], post['reply'], row['cc'], post['id']) #TODO: what if this is over 500 characters?
|
toot = "Curious cat user {} asks: {}\nMy answer: {}\nView online at https://curiouscat.me/{}/post/{}".format(sender, post['comment'], post['reply'], row['cc'], post['id']) #TODO: what if this is over 500 characters?
|
||||||
if settings['cw']:
|
if settings['cw']:
|
||||||
client.status_post(toot, spoiler_text="Curious Cat post")
|
client.status_post(toot, spoiler_text="Curious Cat post")
|
||||||
else:
|
else:
|
||||||
|
|
3
web.py
3
web.py
|
@ -244,3 +244,6 @@ def ccc_c():
|
||||||
@app.route('/cc_connect/complete')
|
@app.route('/cc_connect/complete')
|
||||||
def cc_connect_complete():
|
def cc_connect_complete():
|
||||||
return render_template('cc_connect_complete.html', bg="background-image:url('{}')".format(session['ccavi']))
|
return render_template('cc_connect_complete.html', bg="background-image:url('{}')".format(session['ccavi']))
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
app.run(host="0.0.0.0", port=4734) #4734 is t9 for 'greg'
|
Loading…
Reference in a new issue