Reg Twitter Streaming api


Hi Im building a app which must fetch real time tweets and mentions. I started with using Streaming api by installing TweetStream gem. I was able to do a keyword search. I want to fetch the @mentions and DM’s for one particular twitter handle. When i used TweetStream with userstream its displaying all the tweets in the timeline.I want the metions which has my twitter handle say “@test” and DM’s to this @test. Can you pls help me out.

For your reference,

TweetStream.configure do |config|
  config.consumer_key       =  CONSUMER_TOKEN
  config.consumer_secret    =  CONSUMER_SECRET
  config.oauth_token        =  OAUTH_TOKEN
  config.oauth_token_secret = OAUTH_TOKEN_SECRET
  config.auth_method        = :oauth

client =

client.on_reconnect do |timeout,retries|
  puts "reconnnecting"

client.on_inited do
  puts 'Connected'

client.on_timeline_status do |status|
  puts "timeline status"
  puts status.text

closed #2