원클릭으로
add-filter
Create a new filter for the tracker system. Use when adding custom filtering logic or when the user asks to create a filter.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Create a new filter for the tracker system. Use when adding custom filtering logic or when the user asks to create a filter.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Search OLX.pt listings, track prices, and detect deals. Use for finding products, monitoring prices, and getting alerts on good deals in Portugal and other OLX regions.
Create a new notification backend (e.g., Telegram, Email, Slack). Use when adding custom notification channels.
Build the olx-tracker project. Use when compiling the project or when the user asks to build.
Create a git commit following project conventions. Use when the user asks to commit changes or create a commit.
Check code quality and formatting. Use when checking code style, running pre-commit checks, or when the user asks to lint or format code.
Run olx-tracker CLI commands. Use when executing tracker operations, managing searches, or testing the application.
| name | add-filter |
| description | Create a new filter for the tracker system. Use when adding custom filtering logic or when the user asks to create a filter. |
| user-invocable | false |
Create a new filter for the olx-tracker filtering system.
Filters implement the Filter trait and are applied in a chain to include/exclude listings.
Create src/filters/$ARGUMENTS.rs or src/filters/my_filter.rs:
use crate::api::OfferData;
use crate::db::Search;
use super::Filter;
pub struct MyFilter;
impl Filter for MyFilter {
fn apply(&self, offer: &OfferData, search: &Search) -> bool {
// Return true to include listing, false to exclude
true
}
fn name(&self) -> &'static str {
"MyFilter"
}
}
Add to src/filters/mod.rs:
mod my_filter;
pub use my_filter::MyFilter;
To apply filter automatically, add to FilterChain::with_defaults() in src/filters/mod.rs:
pub fn with_defaults() -> Self {
let mut chain = Self::new();
chain.add(Box::new(KeywordFilter));
chain.add(Box::new(RadiusFilter));
chain.add(Box::new(PriceFilter));
chain.add(Box::new(MyFilter)); // Add your filter here
chain
}
Add tests in the same file under #[cfg(test)] module:
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_my_filter() {
let filter = MyFilter;
// Test filter logic
}
}
KeywordFilter: Filters by keyword match in titleRadiusFilter: Filters by location/city matchPriceFilter: Filters by min/max price rangepub trait Filter {
fn apply(&self, offer: &OfferData, search: &Search) -> bool;
fn name(&self) -> &'static str;
}
Return true to include the listing, false to exclude it.