You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
human_filter="lower(coalesce(author_name, '')) not in ('github', 'dependabot')"
137
+
human_filter="lower(coalesce(mem.username, mem.display_name, m.author_id, '')) not in ('github', 'dependabot')"
130
138
love_terms="(lower(coalesce(normalized_content, content, '')) like '%love%' or lower(coalesce(normalized_content, content, '')) like '%great%' or lower(coalesce(normalized_content, content, '')) like '%awesome%' or lower(coalesce(normalized_content, content, '')) like '%amazing%' or lower(coalesce(normalized_content, content, '')) like '%thanks%' or lower(coalesce(normalized_content, content, '')) like '%thank you%' or lower(coalesce(normalized_content, content, '')) like '%works%' or lower(coalesce(normalized_content, content, '')) like '%useful%' or lower(coalesce(normalized_content, content, '')) like '%helpful%' or lower(coalesce(normalized_content, content, '')) like '%fast%')"
131
139
complaint_terms="(lower(coalesce(normalized_content, content, '')) like '%bug%' or lower(coalesce(normalized_content, content, '')) like '%broken%' or lower(coalesce(normalized_content, content, '')) like '%fail%' or lower(coalesce(normalized_content, content, '')) like '%error%' or lower(coalesce(normalized_content, content, '')) like '%crash%' or lower(coalesce(normalized_content, content, '')) like '%regression%' or lower(coalesce(normalized_content, content, '')) like '%slow%' or lower(coalesce(normalized_content, content, '')) like '%confusing%' or lower(coalesce(normalized_content, content, '')) like '%annoying%' or lower(coalesce(normalized_content, content, '')) like '%not working%' or lower(coalesce(normalized_content, content, '')) like '%cannot%' or lower(coalesce(normalized_content, content, '')) like '%can''t%')"
140
+
body_love_terms="(lower(body) like '%love%' or lower(body) like '%great%' or lower(body) like '%awesome%' or lower(body) like '%amazing%' or lower(body) like '%thanks%' or lower(body) like '%thank you%' or lower(body) like '%works%' or lower(body) like '%useful%' or lower(body) like '%helpful%' or lower(body) like '%fast%')"
141
+
body_complaint_terms="(lower(body) like '%bug%' or lower(body) like '%broken%' or lower(body) like '%fail%' or lower(body) like '%error%' or lower(body) like '%crash%' or lower(body) like '%regression%' or lower(body) like '%slow%' or lower(body) like '%confusing%' or lower(body) like '%annoying%' or lower(body) like '%not working%' or lower(body) like '%cannot%' or lower(body) like '%can''t%')"
142
+
recent_human_cte="
143
+
with recent as (
144
+
select
145
+
m.created_at,
146
+
coalesce(nullif(c.name, ''), m.channel_id) as channel,
147
+
coalesce(nullif(mem.display_name, ''), nullif(mem.username, ''), m.author_id, '') as author,
148
+
coalesce(nullif(m.content, ''), m.normalized_content, '') as body
149
+
from messages m
150
+
left join channels c on c.id = m.channel_id
151
+
left join members mem on mem.guild_id = m.guild_id and mem.user_id = m.author_id
152
+
where $human_filter
153
+
order by m.rowid desc
154
+
limit 50000
155
+
)"
132
156
github_since=$(date_utc_days_ago 30)
133
157
134
158
cat >"$TMP_DIR/context.md"<<EOF
@@ -165,44 +189,48 @@ from messages where created_at >= $since_30;
165
189
"
166
190
167
191
run_sql "Human Hot Channels This Week""
168
-
select coalesce(nullif(channel_name, ''), channel_id) as channel, count(*) as messages
169
-
from messages
170
-
where created_at >= $since_7 and $human_filter
192
+
$recent_human_cte
193
+
select channel, count(*) as messages
194
+
from recent
171
195
group by 1
172
196
order by messages desc
173
197
limit 8;
174
198
"
175
199
176
-
run_sql "What People Seem To Love""
177
-
select coalesce(nullif(channel_name, ''), channel_id) as channel, count(*) as matches
178
-
from messages
179
-
where created_at >= $since_30 and $human_filter and $love_terms
200
+
run_sql "What People Seem To Love In Recent Messages""
201
+
$recent_human_cte
202
+
select channel, count(*) as matches
203
+
from recent
204
+
where $body_love_terms
180
205
group by 1
181
206
order by matches desc
182
207
limit 8;
183
208
"
184
209
185
210
run_sql "Love Samples""
186
-
select created_at, coalesce(nullif(channel_name, ''), channel_id) as channel, coalesce(nullif(author_name, ''), author_id) as author, substr(coalesce(content, normalized_content, ''), 1, 260) as sample
187
-
from messages
188
-
where created_at >= $since_30 and $human_filter and $love_terms
211
+
${recent_human_cte}
212
+
select created_at, channel, author, substr(body, 1, 260) as sample
213
+
from recent
214
+
where $body_love_terms
189
215
order by created_at desc
190
216
limit 10;
191
217
"
192
218
193
-
run_sql "What People Complain About""
194
-
select coalesce(nullif(channel_name, ''), channel_id) as channel, count(*) as matches
195
-
from messages
196
-
where created_at >= $since_30 and $human_filter and $complaint_terms
219
+
run_sql "What People Complain About In Recent Messages""
220
+
$recent_human_cte
221
+
select channel, count(*) as matches
222
+
from recent
223
+
where $body_complaint_terms
197
224
group by 1
198
225
order by matches desc
199
226
limit 8;
200
227
"
201
228
202
229
run_sql "Complaint Samples""
203
-
select created_at, coalesce(nullif(channel_name, ''), channel_id) as channel, coalesce(nullif(author_name, ''), author_id) as author, substr(coalesce(content, normalized_content, ''), 1, 320) as sample
204
-
from messages
205
-
where created_at >= $since_30 and $human_filter and $complaint_terms
230
+
${recent_human_cte}
231
+
select created_at, channel, author, substr(body, 1, 320) as sample
0 commit comments