A tool for parsing traffic on the jetstream and applying a moderation workstream based on regexp based rules

Add post check constants example

Provides examples of checks for spam and promotional content, including
regular expressions and actions to take when matches are found.

Skywatch fed1c8d5 64aed413

Changed files
+30
src
rules
+30
src/rules/posts/constants.example.ts
··· 1 1 import type { Checks } from "../../types.js"; 2 + 3 + export const LINK_SHORTENER = /bit\.ly|tinyurl\.com|ow\.ly/i; 4 + 5 + export const POST_CHECKS: Checks[] = [ 6 + // Example 1: Spam detection 7 + { 8 + label: "spam", 9 + comment: "Post contains spam indicators", 10 + reportPost: true, 11 + reportAcct: false, 12 + commentAcct: false, 13 + toLabel: true, 14 + check: new RegExp( 15 + "click.*?here|limited.*?time.*?offer|act.*?now|100%.*?free", 16 + "i", 17 + ), 18 + whitelist: new RegExp("legitimate.*?offer", "i"), 19 + }, 20 + 21 + // Example 2: Promotional content 22 + { 23 + label: "promotional", 24 + comment: "Promotional content detected", 25 + reportPost: false, 26 + reportAcct: false, 27 + commentAcct: false, 28 + toLabel: true, 29 + check: new RegExp("buy.*?now|discount.*?code|promo.*?link", "i"), 30 + }, 31 + ];