This commit is contained in:
parent
a818b0f99d
commit
7a7dcdfe55
12
bot/bot.py
12
bot/bot.py
|
@ -6,18 +6,18 @@ from datetime import datetime
|
||||||
|
|
||||||
# Set up Mastodon
|
# Set up Mastodon
|
||||||
mastodon = Mastodon(
|
mastodon = Mastodon(
|
||||||
access_token = 'token.secret',
|
access_token='token.secret',
|
||||||
api_base_url = os.getenv('MASTODON_URL', 'https://mastodon.wazongtest.de/')
|
api_base_url=os.getenv('MASTODON_URL', 'https://mastodon.wazongtest.de/')
|
||||||
)
|
)
|
||||||
|
|
||||||
tz = timezone('Europe/Berlin')
|
tz = timezone('Europe/Berlin')
|
||||||
now = datetime.now().astimezone(tz)
|
now = datetime.now().astimezone(tz)
|
||||||
moon_text="Aktuelle Mondphase:\n"
|
moon_text = "Aktuelle Mondphase:\n"
|
||||||
moon_text+=moon.moon_phase_as_text(now)
|
moon_text += moon.moon_phase_as_text(now)
|
||||||
print(moon_text)
|
print(moon_text)
|
||||||
|
|
||||||
mastodon.status_post(moon_text, visibility='unlisted')
|
mastodon.status_post(moon_text, visibility='unlisted')
|
||||||
|
|
||||||
me = mastodon.me()
|
me = mastodon.me()
|
||||||
|
|
||||||
print(mastodon.account_statuses(me['id'])[0])
|
print(mastodon.account_statuses(me['id'])[0])
|
||||||
|
|
Loading…
Reference in a new issue