Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6100067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:20:38+00:00 2026-05-23T13:20:38+00:00

I am using the Tweetstream gem to retrieve statuses from Twitter. This works: Tweetstream::Client.new(‘user’,

  • 0

I am using the Tweetstream gem to retrieve statuses from Twitter. This works:

 Tweetstream::Client.new('user', 'pw').track('alice', 'wonderland') 

However, I know want to limit collecting tweets to both (i) specific users with (ii) specific words. The Tweetstream gem provides this method:

 Tweetstream::Client.new('user', 'pw').filter(query_params = {}, &block)

But I can’t figure out how to pass query_parameters = {}. I’m trying it like this:

 Tweetstream::Client.new('user', 'pw').filter(
               {:follow => ('212380730', '23234252'), 
                :track => ('alice', 'wonderland') 
               } ) 

But I get errors related to syntax, e.g.,

syntax error, unexpected tSYMBEG, expecting ‘}’

Thank you for your help!

The following is from the Tweetstream RDOC:
filter(query_params = {}, &block)

Make a call to the statuses/filter method of the Streaming API, you may provide :follow,
:track or both as options to follow the tweets of specified users or track keywords. This
method is provided separately for cases when it would conserve the number of HTTP
connections to combine track and follow.

This is the source of the .filter method:

 def filter(query_params = {}, &block)
   [:follow, :track].each do |param|
   if query_params[param].is_a?(Array)
   query_params[param] = query_params[param].collect{|q| q.to_s}.join(',')
     elsif query_params[param]
       query_params[param] = query_params[param].to_s
     end
   end
   start('statuses/filter', query_params.merge(:method => :post), &block)
 end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:20:38+00:00Added an answer on May 23, 2026 at 1:20 pm

    i think you mean [] instead of using () as your filter and track, the :filter and :track in query params are supposed to be arrays

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to track a set of keywords from Twitter by using the
I'm using Tweetstream gem to monitor a single twitter userstream and am looking to
Using the http://www.ifans.com/forums/showthread.php?t=132024 post from another question i am allowing the user to enter
Using the C# Facebook SDK 5.0.3 everything works fine whit the client.Get(/me). But when
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
Using C#, I need a class called User that has a username, password, active
I need to save in real-time to a database all tweets from the Twitter
Using jQuery, how do I get the value from a textbox and then load
using file_get_contents , I open an Internet URL and get the contents of this
I would like to read the deleted statuses on twitter since i can already

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.