Suppose I have a website where users create threads and write threads on Fruit.
To inform users of all Fruit conversations throughout the web page, I collect tweets related to a particular topic and create themes based on the contents of the tweet.
It’s very important that tweets are relevant to the topic, obviously. Let's say that the user creates the theme "Apples and Oranges". I pull out all the tweets containing the keywords Apples an or oranges.
The problem I am facing is that some Twitter users use a tweet that includes the keywords "Apples", "Oranges", "Pears," for example, and they collect and publish as a thread in the discussion topic "Apples and oranges. " It makes users angry!
So, I need a way to filter out any tweet that includes fruit words other than apples and / or oranges.
For example, if a twitter user writes “I love apples, oranges, pears and grapes,” then this tweet should not be included.
Now you can make Twitter search so complicated. Thus, the exception logic must be executed in Ruby after collecting the tweets.
Programmatically, how would you decide to solve this?
source share