From cc86f86f8ad5df95518a67d96de6656dcbf39574 Mon Sep 17 00:00:00 2001 From: Nick Gerakines <12125+ngerakines@users.noreply.github.com> Date: Thu, 7 Nov 2024 10:20:37 -0500 Subject: [PATCH] documentation: Added match likes playbook Signed-off-by: Nick Gerakines <12125+ngerakines@users.noreply.github.com> --- docs/playbook-match-likes.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 docs/playbook-match-likes.md diff --git a/docs/playbook-match-likes.md b/docs/playbook-match-likes.md new file mode 100644 index 0000000..4d9eac8 --- /dev/null +++ b/docs/playbook-match-likes.md @@ -0,0 +1,31 @@ +# Playbook: Match on likes + +The feed configuration supports the optional `aturi` attribute, which can be used to extract the post AT-URI from events. + +Using this feature, we can match on non-post records, such as likes. + +## Configuration + +To match on likes, we need to make 2 changes: + +1. Add the `aturi` attribute to the feed configuration. +2. Set the environment value `COLLECTIONS` to include `app.bsky.feed.like,app.bsky.feed.post`. When not explicitly set, the default value is `app.bsky.feed.post`. + +## Example + +In this example feed configuration block, the the `aturi` attribute is set to `$.commit.record.subject.uri`. That JSONPath matches the strong-ref `subject` inside of `{"$type":"app.bsky.feed.like"}` records. + +This configuration will match against all like records where the subject is a post of `did:plc:decafbad`. + +```yaml +feeds: +- uri: "at://did:plc:decafbad/app.bsky.feed.generator/my_popular_posts" + name: "My popular posts" + description: "Posts that I've made that have been liked." + aturi: "$.commit.record.subject.uri" + matchers: + - path: "$.commit.record.subject.uri" + value: "at://did:plc:decafbad/app.bsky.feed.post/" + type: prefix +``` + -- 2.51.2