Hello,
I am trying to create a workflow in which tweets are pulled through twitter, then filtered through keyword via Node.js code and if the tweet contains one of the keywords, send to next process. Can someone help me or guide me on this.
Thanks
Hello,
I am trying to create a workflow in which tweets are pulled through twitter, then filtered through keyword via Node.js code and if the tweet contains one of the keywords, send to next process. Can someone help me or guide me on this.
Thanks
@rzey Let me know if this works for you:
@
sign, as the Search Term . This will trigger the workflow each time you’re mentioned.// If the tweet text does NOT contain the word "test", exit
if (!steps.trigger.event.full_text.match(/test/g)) {
$end("not a match")
}
Take a look at this workflow for an example. Let me know if that helps!
Thanks,
Dylan
Dear Sir,
Thanks for your response and code. I would be grateful if you can advise how to add multiple keywords (above you have used one keyword “test”).
Kind Regards,
Raza
One technique I like to use is simply to modify the regular expression to include the |
operator, which means “OR”. So if you run something like:
if (!steps.trigger.event.full_text.match(/test|hello|world/g)) {
$end("not a match")
}
It will match if the tweet contains the word “test” OR “hello” OR “world”.
much appreciated thanks
Dear Sir,
What shall i use if i want to ignore tweets if they contain a specific keyword
Thanks and Kind Regards,
Raza
Before, you ran this code to only process tweets that matched specific keywords:
if (!steps.trigger.event.full_text.match(/test|hello|world/g)) {
$end("not a match")
}
If you’d like to ignore specific keywords, just remove the !
at the front:
if (steps.trigger.event.full_text.match(/keywords|to|ignore/g)) {
$end("Tweet matched keyword on ignore list")
}
Dear Sir,
Highly appreciated.
Thanks