Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat are query_parameters and how do I pass them to Tweetstream::Client...filter(query_parameters = {})
    primarykey
    data
    text
    <p>I am using the Tweetstream gem to retrieve statuses from Twitter. This works:</p> <pre><code> Tweetstream::Client.new('user', 'pw').track('alice', 'wonderland') </code></pre> <p>However, I know want to limit collecting tweets to both (i) specific users with (ii) specific words. The Tweetstream gem provides this method: </p> <pre><code> Tweetstream::Client.new('user', 'pw').filter(query_params = {}, &amp;block) </code></pre> <p>But I can't figure out how to pass query_parameters = {}. I'm trying it like this: </p> <pre><code> Tweetstream::Client.new('user', 'pw').filter( {:follow =&gt; ('212380730', '23234252'), :track =&gt; ('alice', 'wonderland') } ) </code></pre> <p>But I get errors related to syntax, e.g., </p> <blockquote> <p>syntax error, unexpected tSYMBEG, expecting '}'</p> </blockquote> <p>Thank you for your help!</p> <p>The following is from the Tweetstream RDOC: filter(query_params = {}, &amp;block)</p> <blockquote> <p>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.</p> </blockquote> <p>This is the source of the .filter method: </p> <pre><code> def filter(query_params = {}, &amp;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 =&gt; :post), &amp;block) end </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload