Merge branch 'master' of github.com:martinrotter/rssguard

This commit is contained in:
Martin Rotter 2022-02-12 19:51:06 +01:00
commit 69bcff163f

View file

@ -172,10 +172,13 @@ Note that `MessageObject` attributes which can be synchronized with service are
| Method | `runExecutableGetOutput(String, String[])` | `String` | `utils.runExecutableGetOutput('cmd.exe', ['/c', 'dir'])` | Launches external executable with optional parameters, reads its standard output and returns the output when executable finishes. | Method | `runExecutableGetOutput(String, String[])` | `String` | `utils.runExecutableGetOutput('cmd.exe', ['/c', 'dir'])` | Launches external executable with optional parameters, reads its standard output and returns the output when executable finishes.
#### Examples #### Examples
Accept only messages/articles with title containing "Series Name" in it: Accept only messages/articles with title containing "Series Name" or "Another series" in it (whitelist):
```js ```js
var whitelist = [
'Series Name', 'Another series'
];
function filterMessage() { function filterMessage() {
if (msg.title.indexOf('Series Name') != -1) { if (whitelist.some(i => msg.title.indexOf(i) != -1)) {
return MessageObject.Accept; return MessageObject.Accept;
} else { } else {
return MessageObject.Ignore; return MessageObject.Ignore;
@ -183,13 +186,16 @@ function filterMessage() {
} }
``` ```
Accept only messages/articles with title NOT containing "Other Series Name" or "Some other title" in it: Accept only messages/articles with title NOT containing "Other Series Name" or "Some other title" in it (blacklist):
```js ```js
var blacklist = [
'Other Series Name', 'Some other title'
];
function filterMessage() { function filterMessage() {
if (msg.title.indexOf('Other Series Name') == -1 && msg.title.indexOf('Some other title') == -1) { if (blacklist.some(i => msg.title.indexOf(i) != -1)) {
return MessageObject.Accept;
} else {
return MessageObject.Ignore; return MessageObject.Ignore;
} else {
return MessageObject.Accept;
} }
} }
``` ```