I would like to make an automation where when a user comments on one of my tweets a special keyword like “Add me” then they will be sent a direct message (DM) with a custom message.
How can I do this? I am mainly looking for the trigger aspect of this. I know how to do the DM bit but cant find a suitable trigger for this event,
How would you deal with the trigger tho? Like I would like to have it so when someone comments then it would check it and act accordingly.
from the link you sent, it seems like I have to trigger this event on a schedule. however, I think Twitter API would rate limit me so it wouldnt be as useful as I would like it to be.
There is no webhook from twitter for this so you will need to use a method called polling. All n8n triggers under the hood use webhooks or polling.
Polling is where you make requests at intervals, like every 60 seconds, and compares the current request with the last one to see if anything is new. You can also check the timestamp from the comment and see if it was within the last intervals time, but I am not sure if twitter includes that.
So you would just need to make your own polling trigger, which would mean having a schedule trigger that calls the twitter API every so often and checks for those comments then goes forward if there are matching ones
how would I set up the polling if you dont mind me asking.
I have few automations and I am manually handling the old vs new data logic. If there is a node that is can do this for me then it would save me a lot of time and simplify some of my automations.
I see, Again this probably would increase the count on my API rate limit.
Thank you for your help and time my friend. Much appreciated. the link was useful for the API reference.