Hi there,

I’m trying to make a Twitter bot that will post when someone mentions it, pulling in an image from a bank of stock photographs, with the image also having a caption of the original tweet.

Would something like this be feasible to automate? And if so, what would be the best/easiest method of set up?

I’d also be interested in knowing if there is a way to vet the tags to prevent improper use of the bot, either through a pre-approval process or some kind of profanity filter.

Any help would be much appreciated.

Thanks a lot.

@jessicagarson maybe it’s more appropriate to answer

I think this is done with the search endpoint.

  1. First use the search endpoint to find the mention. Or use get-users-id-mentions timeline endpoint
  2. Then do what you would do with the results, e.g. keyword matching for images
  3. use the search endpoint also for that keyword to get the appropriate image
  4. Finally send a reply with a retweet quote of the expected image