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