Custom Filtering
When filter_item() exists in your hook, the built-in keyword filter is skipped entirely. This gives you full control over which items make it to the database.
name = "Custom Filter Example"url = "https://example-jobs.com/listings"selector = ".job-card"interval = 60
fields = [ "title:h3.job-title", "company:.company-name", "salary:.salary-range", "link:a.apply-link@href",]blocked_companies = { ["spam corp"] = true, ["scam inc"] = true,}
function filter_item(item) local title = (item.fields.title or ""):lower() local company = (item.fields.company or ""):lower()
if blocked_companies[company] then return nil end if string.find(title, "intern") then return nil end
local wanted = {"rust", "go", "python", "kubernetes"} local found = false for _, tech in ipairs(wanted) do if string.find(title, tech) then found = true break end end if not found then return nil end
local min_sal = tonumber(string.match(item.fields.salary or "", "%d+")) if min_sal then item.fields.salary = "$" .. min_sal .. "k+" end
return itemend
function before_notify(items) if #items < 2 then return nil end return itemsendKey Concepts
Section titled “Key Concepts”filter_itemis mutually exclusive withkeywordsin config- Return
nilto drop, return the item to keep - You can mutate fields before storage
before_notifycan silence notifications based on item count