A simple BlueSky profile labeler that can be ran on Cloudflare Workers github.com/SocksTheWolf/SimpleBSkyLabeler
cf bsky profile label bluesky cloudflare workers
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Adds nice readme.

+29 -105
+28 -1
README.md
··· 4 4 service. 5 5 6 6 It omits some features like signatures and support for the `queryLabels` endpoint, 7 - but seems to work just fine with the native bsky.app web and iOS app. 7 + but seems to work just fine with the native bsky.app web and iOS app. 8 + 9 + The idea behind this is to be simple and avoid the complexity present in full 10 + featured labelers, which include a database and a full server that responds to 11 + HTTP requests. I hope you can use this as a good starting point, it should be 12 + fairly easy to translate it to other languages/frameworks too if necessary. 13 + 14 + The below sections explain how to set up your account as a labeler and how to 15 + deploy this worker. These steps are fairly simple and you should have a working 16 + within 5 minutes. 17 + 18 + ## Account setup 19 + 20 + 1. Create a new Bluesky account (do not reuse a personal account for this!) 21 + 2. Run `npx @skyware/labeler setup` and follow the wizard to convert that account into a labeler 22 + 3. The URL of the labeler will be `https://bsky-labeler.<YourUsername>.workers.dev/`. 23 + 4. The label we use in this example is `verified-human`. You can easily change this though. 24 + 25 + ## Worker deployment 26 + 27 + Once your account is set up properly, you can deploy your worker by running 28 + `wrangler deploy` in this repo's directory. 29 + 30 + ## Testing the labeler 31 + 32 + You should then be able to test your new labeler by subscribing to it (just go 33 + on its profile), then if you view the profile for bsky.app you should see 34 + the new label.
+1 -104
wrangler.toml
··· 8 8 # Docs: https://developers.cloudflare.com/workers/observability/logs/workers-logs/ 9 9 # Configuration: https://developers.cloudflare.com/workers/observability/logs/workers-logs/#enable-workers-logs 10 10 [observability] 11 - enabled = true 12 - 13 - # Automatically place your workloads in an optimal location to minimize latency. 14 - # If you are running back-end logic in a Worker, running it closer to your back-end infrastructure 15 - # rather than the end user may result in better performance. 16 - # Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement 17 - # [placement] 18 - # mode = "smart" 19 - 20 - # Variable bindings. These are arbitrary, plaintext strings (similar to environment variables) 21 - # Docs: 22 - # - https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables 23 - # Note: Use secrets to store sensitive data. 24 - # - https://developers.cloudflare.com/workers/configuration/secrets/ 25 - # [vars] 26 - # MY_VARIABLE = "production_value" 27 - 28 - # Bind the Workers AI model catalog. Run machine learning models, powered by serverless GPUs, on Cloudflare’s global network 29 - # Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai 30 - # [ai] 31 - # binding = "AI" 32 - 33 - # Bind an Analytics Engine dataset. Use Analytics Engine to write analytics within your Pages Function. 34 - # Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets 35 - # [[analytics_engine_datasets]] 36 - # binding = "MY_DATASET" 37 - 38 - # Bind a headless browser instance running on Cloudflare's global network. 39 - # Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering 40 - # [browser] 41 - # binding = "MY_BROWSER" 42 - 43 - # Bind a D1 database. D1 is Cloudflare’s native serverless SQL database. 44 - # Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases 45 - # [[d1_databases]] 46 - # binding = "MY_DB" 47 - # database_name = "my-database" 48 - # database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 49 - 50 - # Bind a dispatch namespace. Use Workers for Platforms to deploy serverless functions programmatically on behalf of your customers. 51 - # Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms 52 - # [[dispatch_namespaces]] 53 - # binding = "MY_DISPATCHER" 54 - # namespace = "my-namespace" 55 - 56 - # Bind a Durable Object. Durable objects are a scale-to-zero compute primitive based on the actor model. 57 - # Durable Objects can live for as long as needed. Use these when you need a long-running "server", such as in realtime apps. 58 - # Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects 59 - # [[durable_objects.bindings]] 60 - # name = "MY_DURABLE_OBJECT" 61 - # class_name = "MyDurableObject" 62 - 63 - # Durable Object migrations. 64 - # Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#migrations 65 - # [[migrations]] 66 - # tag = "v1" 67 - # new_classes = ["MyDurableObject"] 68 - 69 - # Bind a Hyperdrive configuration. Use to accelerate access to your existing databases from Cloudflare Workers. 70 - # Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive 71 - # [[hyperdrive]] 72 - # binding = "MY_HYPERDRIVE" 73 - # id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 74 - 75 - # Bind a KV Namespace. Use KV as persistent storage for small key-value pairs. 76 - # Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces 77 - # [[kv_namespaces]] 78 - # binding = "MY_KV_NAMESPACE" 79 - # id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 80 - 81 - # Bind an mTLS certificate. Use to present a client certificate when communicating with another service. 82 - # Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates 83 - # [[mtls_certificates]] 84 - # binding = "MY_CERTIFICATE" 85 - # certificate_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 86 - 87 - # Bind a Queue producer. Use this binding to schedule an arbitrary task that may be processed later by a Queue consumer. 88 - # Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#queues 89 - # [[queues.producers]] 90 - # binding = "MY_QUEUE" 91 - # queue = "my-queue" 92 - 93 - # Bind a Queue consumer. Queue Consumers can retrieve tasks scheduled by Producers to act on them. 94 - # Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#queues 95 - # [[queues.consumers]] 96 - # queue = "my-queue" 97 - 98 - # Bind an R2 Bucket. Use R2 to store arbitrarily large blobs of data, such as files. 99 - # Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets 100 - # [[r2_buckets]] 101 - # binding = "MY_BUCKET" 102 - # bucket_name = "my-bucket" 103 - 104 - # Bind another Worker service. Use this binding to call another Worker without network overhead. 105 - # Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings 106 - # [[services]] 107 - # binding = "MY_SERVICE" 108 - # service = "my-service" 109 - 110 - # Bind a Vectorize index. Use to store and query vector embeddings for semantic search, classification and other vector search use-cases. 111 - # Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes 112 - # [[vectorize]] 113 - # binding = "MY_INDEX" 114 - # index_name = "my-index" 11 + enabled = true