Merge pull request #552 from cantino/ignore_duplicate_keywords

remove duplicate filter keywords

Andrew Cantino 10 years ago
parent
commit
358af4b7a2
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lib/twitter_stream.rb

+ 3 - 1
lib/twitter_stream.rb

@@ -13,6 +13,8 @@ class TwitterStream
13 13
   end
14 14
 
15 15
   def stream!(filters, agent, &block)
16
+    filters = filters.map(&:downcase).uniq
17
+
16 18
     stream = Twitter::JSONStream.connect(
17 19
       :path    => "/1/statuses/#{(filters && filters.length > 0) ? 'filter' : 'sample'}.json#{"?track=#{filters.map {|f| CGI::escape(f) }.join(",")}" if filters && filters.length > 0}",
18 20
       :ssl     => true,
@@ -129,4 +131,4 @@ class TwitterStream
129 131
       end
130 132
     end
131 133
   end
132
-end
134
+end