+17
-1
app/feeds/linux_feed.rb
+17
-1
app/feeds/linux_feed.rb
···
7
7
/apt\-get/, /\bflatpak\b/i, /\b[Xx]org\b/
8
8
]
9
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
+
10
23
def feed_id
11
24
2
12
25
end
···
24
37
end
25
38
26
39
def post_matches?(post)
27
-
REGEXPS.any? { |r| post.text =~ r }
40
+
return false if MUTED_PROFILES.include?(post.repo)
41
+
42
+
REGEXPS.any? { |r| post.text =~ r } && !(EXCLUDE.any? { |r| post.text =~ r })
28
43
end
29
44
30
45
def colored_text(t)
31
46
text = t.dup
32
47
48
+
EXCLUDE.each { |r| text.gsub!(r) { |s| Rainbow(s).red }}
33
49
REGEXPS.each { |r| text.gsub!(r) { |s| Rainbow(s).green }}
34
50
35
51
text