this repo has no description

chore: atmosphere dev feed matcher updates

Signed-off-by: Nick Gerakines <12125+ngerakines@users.noreply.github.com>

+52 -16
+52 -16
etc/atmosphere_dev.rhai
··· 1 1 let rtype = event?.commit?.record?["$type"]; 2 2 3 + if rtype == "app.bsky.feed.like" { 4 + return update_match(build_aturi(event)); 5 + } 6 + 3 7 if rtype != "app.bsky.feed.post" { 4 8 return false; 5 9 } ··· 10 14 // Used a lot with tags like "dogsofbluesky" 11 15 "ofbluesky", 12 16 "ofbsky", 17 + "onbsky", 18 + "onbluesky", 19 + // Stuff that is also "art" related is usually not developer releated. 20 + "art", "illustration", 13 21 ]; 14 22 15 - let score = 0; 23 + const LIKELY_DIDS = [ 24 + "did:plc:ewvi7nxzyoun6zhxrhs64oiz", 25 + "did:plc:oc6vwdlmk2kqyida5i74d3p5", 26 + "did:plc:lehcqqkwzcwvjvw66uthu5oq", 27 + "did:plc:z72i7hdynmk6r22z27h6tvur", 28 + ]; 29 + 30 + const MAYBE_DIDS = [ 31 + "did:plc:q6gjnaw2blty4crticxkmujt", 32 + "did:plc:oky5czdrnfjpqslsw2a5iclo", 33 + "did:plc:ragtjsm2j2vknwkz3zp4oxrd", 34 + "did:plc:cbkjy5n7bk3ax2wplmtjofq2", 35 + "did:plc:tgudj2fjm77pzkuawquqhsxm", 36 + "did:plc:kkoqcj4msmlta4nr47g6pk4r", 37 + ]; 38 + 39 + let score = 0.0; 16 40 17 41 const KEYWORDS = [ 18 - ["atproto"], 19 - ["feed", "generator"], 20 - ["pds"], 21 - ["jetstream"], 22 - ["firehose"], 23 - ["bluesky", "infra"], 42 + [["atproto"], 2.0], 43 + [["feed", "generator"], 2.0], 44 + [["pds"], 0.5], 45 + [["jetstream"], 0.5], 46 + [["firehose"], 0.5], 47 + [["bluesky", "infra"], 2.0], 24 48 ]; 25 49 const TAGS = [ 26 50 ["atproto"], 27 51 ["feed", "generator"], 28 52 ["pds"], 29 - ["bluesky"], 30 - ["bsky"], 31 53 ["atmosphere"], 54 + ["atrium-rs"], 55 + ["supercell"], 56 + ["smokesignal"], 32 57 ]; 33 58 34 59 const URLS = [ ··· 46 71 } 47 72 } 48 73 49 - for needle in KEYWORDS { 50 - if sequence_matches(needle, text_normalized) { 51 - score += 1; 74 + for keyword in KEYWORDS { 75 + if sequence_matches(keyword[0], text_normalized) { 76 + score += keyword[1]; 52 77 } 53 78 } 54 79 ··· 56 81 if !embed_external_url.is_empty() { 57 82 for needle in URLS { 58 83 if embed_external_url.starts_with(needle) { 59 - score += 1; 84 + score += 1.0; 60 85 } 61 86 } 62 87 } ··· 66 91 for facet in event?.commit?.record?.facets ?? [] { 67 92 for feature in facet?.features ?? [] { 68 93 switch feature?["$type"] { 94 + "app.bsky.richtext.facet#mention" => { 95 + let mention = feature?["did"] ?? ""; 96 + if !mention.is_empty() { 97 + if mention in LIKELY_DIDS { 98 + score += 1.0; 99 + } 100 + if mention in MAYBE_DIDS { 101 + score += 0.5; 102 + } 103 + } 104 + } 69 105 "app.bsky.richtext.facet#link" => { 70 106 let link = feature?["uri"] ?? ""; 71 107 if !link.is_empty() { 72 108 for needle in URLS { 73 109 if link.starts_with(needle) { 74 - score += 1; 110 + score += 1.0; 75 111 } 76 112 } 77 113 } ··· 86 122 } 87 123 for needle in TAGS { 88 124 if sequence_matches(needle, tag_normalized) { 89 - score += 1; 125 + score += 1.0; 90 126 } 91 127 } 92 128 } ··· 95 131 } 96 132 } 97 133 98 - if score > 0 { 134 + if score >= 1.0 { 99 135 return build_aturi(event); 100 136 } 101 137