Template of a custom feed generator service for the Bluesky network in Ruby

mute spam about Mastodon etc.

Changed files
+17 -1
app
+17 -1
app/feeds/linux_feed.rb
··· 7 /apt\-get/, /\bflatpak\b/i, /\b[Xx]org\b/ 8 ] 9 10 def feed_id 11 2 12 end ··· 24 end 25 26 def post_matches?(post) 27 - REGEXPS.any? { |r| post.text =~ r } 28 end 29 30 def colored_text(t) 31 text = t.dup 32 33 REGEXPS.each { |r| text.gsub!(r) { |s| Rainbow(s).green }} 34 35 text
··· 7 /apt\-get/, /\bflatpak\b/i, /\b[Xx]org\b/ 8 ] 9 10 + EXCLUDE = [ 11 + /\bmastos?\b/i, /mast[oa]d[oa]n/i, /\bfederat(ion|ed)\b/i, /fediverse/i, /at\s?protocol/i, 12 + /social (media|networks?)/i, /microblogging/i, /\bthreads\b/i, /\bnostr\b/i, 13 + /the linux of/i, /linux (bros|nerds)/i, /ubuntu tv/i 14 + ] 15 + 16 + MUTED_PROFILES = [ 17 + 'did:plc:35c6qworuvguvwnpjwfq3b5p', # Linux Kernel Releases 18 + 'did:plc:ppuqidjyabv5iwzeoxt4fq5o', # GitHub Trending JS/TS 19 + 'did:plc:eidn2o5kwuaqcss7zo7ivye5', # GitHub Trending 20 + 'did:plc:lontmsdex36tfjyxjlznnea7', # RustTrending 21 + ] 22 + 23 def feed_id 24 2 25 end ··· 37 end 38 39 def post_matches?(post) 40 + return false if MUTED_PROFILES.include?(post.repo) 41 + 42 + REGEXPS.any? { |r| post.text =~ r } && !(EXCLUDE.any? { |r| post.text =~ r }) 43 end 44 45 def colored_text(t) 46 text = t.dup 47 48 + EXCLUDE.each { |r| text.gsub!(r) { |s| Rainbow(s).red }} 49 REGEXPS.each { |r| text.gsub!(r) { |s| Rainbow(s).green }} 50 51 text