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
feat: track other atproto collections
Eric Davis
1 year ago
bbcd73d3
24686254
+16
-8
1 changed file
expand all
collapse all
unified
split
bsky-activity.py
+16
-8
bsky-activity.py
···
10
10
import redis
11
11
import websockets
12
12
13
13
-
app_bsky_allowlist = set([
13
13
+
app_bsky_allowlist = (
14
14
'app.bsky.actor.profile',
15
15
'app.bsky.feed.generator',
16
16
'app.bsky.feed.like',
···
26
26
'app.bsky.graph.starterpack',
27
27
'app.bsky.labeler.service',
28
28
'chat.bsky.actor.declaration',
29
29
-
])
29
29
+
)
30
30
31
31
-
other_allowlist = set([
32
32
-
'social.psky.feed.post',
33
33
-
'social.psky.chat.message',
34
34
-
'blue.zio.atfile.upload',
35
35
-
])
31
31
+
other_allowlist = (
32
32
+
'social.psky',
33
33
+
'blue.zio.atfile',
34
34
+
'com.shinolabs.pinksea',
35
35
+
'com.whtwnd',
36
36
+
'events.smokesignal',
37
37
+
'fyi.unravel',
38
38
+
'xyz.statusphere',
39
39
+
)
36
40
37
41
async def bsky_activity():
38
42
relay_url = 'wss://jetstream1.us-west.bsky.network/subscribe'
···
64
68
continue
65
69
66
70
collection = payload['collection']
67
67
-
if collection not in app_bsky_allowlist | other_allowlist:
71
71
+
if not collection.startswith(app_bsky_allowlist + other_allowlist):
68
72
continue
73
73
+
74
74
+
for prefix in other_allowlist:
75
75
+
if collection.startswith(prefix):
76
76
+
redis_pipe.incr('dev.edavis.atproto.collection.' + prefix.replace('.', '_'))
69
77
70
78
repo_did = event['did']
71
79
repo_update_time = datetime.now(timezone.utc)