-
-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FR]: SameId
for article filters
#509
Comments
Well, I guess in my case I can adapt it to the |
not exist yet, can be safely added
Sure, you can do that, I will add sameid to. But your probably do not want
? |
Yes, this one. |
Thank you very much! |
@martinrotter Does not seem to work? |
Will double check. |
I checked and made some changes and should work, sample log from app:
Sample filter: function filterMessage() {
console.log("Message custom ID: " + msg.customId);
var isDupl = msg.isDuplicate(MessageObject.SameCustomId);
return isDupl ? MessageObject.Ignore : MessageObject.Accept;
} |
Although my script does not look as neat, it does work with const conditions = [
'title1',
'title2'
];
function filterMessage() {
if (msg.isDuplicateWithAttribute(MessageObject.SameCustomId)) {
return MessageObject.Ignore;
}
else if (conditions.some(el => msg.title.includes(el)) >= 1) {
return MessageObject.Accept;
}
else {
return MessageObject.Ignore;
}
} Thoughts? |
let me test your script, do you have any specific feed i can test with? (not all feed provide "id" for their articles) |
btw your else if (conditions.some(el => msg.title.includes(el))) {
return MessageObject.Accept;
} |
Well, I use it with custom feed (and I certainly know that the ids remain constant), but it would take some hours of me to rewrite it here now.
Don't worry, my JS knowledge is awfully basic, that part was something I adopted from stackoverflow, (I mean I forget it tomorrow, or after an hour 😄 ) but thank you. |
@sakkamade Just tested your script (second sync run, first sync downloaded articles, then I enabled the filter):
|
Oh, right. I forgot that it is a very specific filter for very specific feed... Later then. |
This means that filter rejected all messages as their duplicate check with custom ID revealed that they already are in the DB. |
I am almost certain, however, that the fault is not there, since with |
Yes and no. Because the date (content, author, etc.) have not changed too, therefore they might not update. But in that feed the date of every article changes upon every fetch. |
you see the actual SQL command executed to determine the "duplicity" result, to me, the commands seem to be correct... |
When I say it does not work for me, I mean it does not work for me, please believe me. By the way, the last time I tested it was with this commit 2f39114. |
You know, it just occurred to me, that feed is RSS 2.0, and since I have not really dealt with it I am not sure, but according to the first link I have just found https://validator.w3.org/feed/docs/rss2.html#hrelementsOfLtitemgt, the RSS 2.0 has EDIT: As well as to second: https://www.w3schools.com/XML/xml_rss.asp ... |
I am apologise for taking your time. |
@sakkamade |
Yes, of course that was "id"...
Better late than never, I guess. |
Brief description of the feature request
At last laying my hands on scraping and filtering features (truly amazing thing, btw), I found that a crucial for me element is likely missing.
It is also not documented here, so I suspect that it does not exist yet.
The text was updated successfully, but these errors were encountered: