From 1714ec444c5944e7eca0d1ff46416151e75089c4 Mon Sep 17 00:00:00 2001 From: Nick Gerakines <12125+ngerakines@users.noreply.github.com> Date: Tue, 12 Nov 2024 20:47:44 +0000 Subject: [PATCH] chore: Updating atmosphere_dev feed matcher to calc score Signed-off-by: Nick Gerakines <12125+ngerakines@users.noreply.github.com> --- etc/atmosphere_dev.rhai | 16 +++++++++++----- 1 file(s) changed, 11 insertion(s)(+), 5 deletion(s)(-) diff --git a/etc/atmosphere_dev.rhai b/etc/atmosphere_dev.rhai --- a/etc/atmosphere_dev.rhai +++ b/etc/atmosphere_dev.rhai @@ -6,18 +6,21 @@ } const BAIL = [ // For obvious reasons, keep the feed to PG - "nsfw", + "nsfw", "porn", // Used a lot with tags like "dogsofbluesky" "ofbluesky", "ofbsky", ]; +let score = 0; + const KEYWORDS = [ ["atproto"], ["feed", "generator"], ["pds"], ["jetstream"], ["firehose"], + ["bluesky", "infra"], ]; const TAGS = [ ["atproto"], @@ -45,7 +48,7 @@ } for needle in KEYWORDS { if sequence_matches(needle, text_normalized) { - return build_aturi(event); + score += 1; } } @@ -53,7 +56,7 @@ let embed_external_url = event?.commit?.record?.embed?.external?.uri ?? ""; if !embed_external_url.is_empty() { for needle in URLS { if embed_external_url.starts_with(needle) { - return build_aturi(event); + score += 1; } } } @@ -68,7 +71,7 @@ let link = feature?["uri"] ?? ""; if !link.is_empty() { for needle in URLS { if link.starts_with(needle) { - return build_aturi(event); + score += 1; } } } @@ -83,7 +86,7 @@ } } for needle in TAGS { if sequence_matches(needle, tag_normalized) { - return build_aturi(event); + score += 1; } } } @@ -92,5 +95,8 @@ } } } +if score > 0 { + return build_aturi(event); +} false -- tangled.sh