Skip to content

Article Filter: How do I add msg.isImportant to whitelist keywords and Labels to blacklist keywords? #988

Answered by Mitecon
Crehet asked this question in Q&A
Discussion options

You must be logged in to vote

Firstly, why not have two labels? Something like:

Accepted
Unwanted

This way, you can see what's matched your wanted list and then everything else that matches your unwanted list is still there for review.

So it looks like you want this to be marked Important:

var whitelist = [
  'Pepa', 'Max-Steel'
];

and this to be in a label:

var blacklist = [
  'John Wick 1', 'John Wick 2'
];

Then what do you want to do with everything else? Do you only want the articles matching either of the conditions above in the database? Or do you want the above to happen and also keep all other articles? This part is unclear to me.

Anyway, the main problem part is the 'else if' statement. The syntax is sligh…

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@Crehet
Comment options

Answer selected by Crehet
Comment options

You must be logged in to vote
1 reply
@Crehet
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants