Improve seller account filtering
This commit is contained in:
1 parent
d819a0f1e6
commit
f4e8fdc42f
5 files changed
+178
-52
No files matched your search
@@ -48,6 +48,32 @@ export class MonitorService {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (
|
||||
this.config.reddit.filterSellers &&
|
||||
(this.config.reddit.sellerKeywords.length > 0 || this.config.reddit.sellerDomains.length > 0)
|
||||
) {
|
||||
const isSeller = await this.redditApi.isSellerProfile(
|
||||
post.author,
|
||||
this.config.reddit.sellerKeywords,
|
||||
this.config.reddit.sellerDomains,
|
||||
post,
|
||||
);
|
||||
if (isSeller) {
|
||||
this.logger.info(`Skipping post ${post.id} from u/${post.author} - seller signals detected`);
|
||||
this.postsRepo.insert({
|
||||
id: post.id,
|
||||
subreddit: post.subreddit,
|
||||
author: post.author,
|
||||
title: post.title,
|
||||
postUrl: this.redditApi.getPostUrl(post),
|
||||
imageUrl: subreddit.type === 'image' ? this.redditApi.getImageUrl(post) : null,
|
||||
processedAt: Date.now(),
|
||||
});
|
||||
this.postsRepo.setError(post.id, 'Seller signals detected');
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Chat subs almost always have a self-declared gender tag in the
|
||||
// title/body (e.g. [25F], M4F). Drop posts that don't match the
|
||||
// configured targetGenders here so they never enter the processor.
|
||||
|
||||
Reference in new issue
Block a user