this repo has no description

feat: track other atproto collections

+16 -8
+16 -8
bsky-activity.py
··· 10 10 import redis 11 11 import websockets 12 12 13 - app_bsky_allowlist = set([ 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 + ) 30 30 31 - other_allowlist = set([ 32 - 'social.psky.feed.post', 33 - 'social.psky.chat.message', 34 - 'blue.zio.atfile.upload', 35 - ]) 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 + ) 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 - if collection not in app_bsky_allowlist | other_allowlist: 71 + if not collection.startswith(app_bsky_allowlist + other_allowlist): 68 72 continue 73 + 74 + for prefix in other_allowlist: 75 + if collection.startswith(prefix): 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)