How can I access tweets from protected Twitter accounts in Pipedream triggers?

Michelle Bergeron : Ah, ok. I see what you mean. You will need to use the User Tweets trigger for that. I see that the SearchText prop is entered in the step steps.search_for_text. The standard Twitch search operators won’t necessarily work, but if you replace the code in that step with this code below, it should work to only find tweets with the whole word(s) instead of tweets where the word is part of a larger string. If you enter multiple words, separated by spaces, as the searchText, it will search for tweets with any of those words (not necessarily all the words). I tested this a little, and it worked for me, but let me know if this works for you.

async (event, steps, params) => {
   const words = params.searchText.split(' ');
   const fullText = steps.trigger.event.full_text;
   let found = false;
   for (const word of words) {
     if (fullText.indexOf(" "+word+" ") >= 0 ||
     fullText.indexOf(word+" ") == 0 ||
     fullText.indexOf(" "+word) == fullText.length - word.length - 1){
       found = true;
     }
   }
   if (!found)
     $end("text not found -- ending the workflow")
   else
     return "found it! proceed from here"
}

Malk : that works perfectly! Thank you so much :slightly_smiling_face:

Danny Roosevelt : Awesome — thanks for closing the loop on this one, Michelle!

Malk : Thank you Danny as well for all your time and help since I started using pipedream!