tangled
alpha
login
or
join now
edavis.dev
/
bsky-tools
0
fork
atom
this repo has no description
0
fork
atom
overview
issues
pulls
pipelines
Add autoposters/bskycharts.py
Eric Davis
2 years ago
aae03834
5d61a69a
+28
1 changed file
expand all
collapse all
unified
split
autoposters
bskycharts.py
+28
autoposters/bskycharts.py
···
1
1
+
#!/usr/bin/env python3
2
2
+
3
3
+
import time
4
4
+
5
5
+
import atproto
6
6
+
7
7
+
8
8
+
BSKY_HANDLE = 'bskycharts.edavis.dev'
9
9
+
BSKY_APP_PASSWORD = ''
10
10
+
BSKY_ACTIVITY_IMAGE_PATH = '/var/www/munin/edavis.dev/bskycharts.edavis.dev/bsky-day.png'
11
11
+
12
12
+
13
13
+
def main():
14
14
+
time.sleep(10) # let the charts finish updating
15
15
+
16
16
+
client = atproto.Client()
17
17
+
client.login(BSKY_HANDLE, BSKY_APP_PASSWORD)
18
18
+
19
19
+
with open(BSKY_ACTIVITY_IMAGE_PATH, 'rb') as chart:
20
20
+
client.send_image(
21
21
+
text = '',
22
22
+
image = chart.read(),
23
23
+
image_alt = 'munin chart showing daily bluesky network activity'
24
24
+
)
25
25
+
26
26
+
27
27
+
if __name__ == '__main__':
28
28
+
main()