this repo has no description

feat: track other atproto collections

Changed files
+16 -8
+16 -8
bsky-activity.py
···
import redis
import websockets
-
app_bsky_allowlist = set([
+
app_bsky_allowlist = (
'app.bsky.actor.profile',
'app.bsky.feed.generator',
'app.bsky.feed.like',
···
'app.bsky.graph.starterpack',
'app.bsky.labeler.service',
'chat.bsky.actor.declaration',
-
])
+
)
-
other_allowlist = set([
-
'social.psky.feed.post',
-
'social.psky.chat.message',
-
'blue.zio.atfile.upload',
-
])
+
other_allowlist = (
+
'social.psky',
+
'blue.zio.atfile',
+
'com.shinolabs.pinksea',
+
'com.whtwnd',
+
'events.smokesignal',
+
'fyi.unravel',
+
'xyz.statusphere',
+
)
async def bsky_activity():
relay_url = 'wss://jetstream1.us-west.bsky.network/subscribe'
···
continue
collection = payload['collection']
-
if collection not in app_bsky_allowlist | other_allowlist:
+
if not collection.startswith(app_bsky_allowlist + other_allowlist):
continue
+
+
for prefix in other_allowlist:
+
if collection.startswith(prefix):
+
redis_pipe.incr('dev.edavis.atproto.collection.' + prefix.replace('.', '_'))
repo_did = event['did']
repo_update_time = datetime.now(timezone.utc)