Browse Source

ignore empty filter tokens

Andrew Cantino 12 years ago
parent
commit
fead62f41d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      bin/twitter_stream.rb

+ 1 - 1
bin/twitter_stream.rb

@@ -70,7 +70,7 @@ def load_and_run(agents)
         recent_tweets.shift if recent_tweets.length > DUPLICATE_DETECTION_LENGTH
         puts status["text"]
         filter_to_agent_map.keys.each do |filter|
-          if filter.downcase.split(SEPARATOR) - status["text"].downcase.split(SEPARATOR) == [] # Hacky McHackerson
+          if (filter.downcase.split(SEPARATOR) - status["text"].downcase.split(SEPARATOR)).reject(&:empty) == [] # Hacky McHackerson
             filter_to_agent_map[filter].each do |agent|
               puts " -> #{agent.name}"
               agent.process_tweet(filter, status)