remove duplicate filter keywords

This commit is contained in:
Andrew Cantino 2014-09-27 10:07:52 -07:00
parent 072bcd366f
commit 492888ffd6

View file

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