Following the documentation but get an error on streams
client = Twitter::Streaming::Client.new do |config|
config.consumer_key = CONSUMER_KEY
config.consumer_secret = CONSUMER_SECRET
config.access_token = ACCESS_TOKEN
config.access_token_secret = ACCESS_TOKEN_SECRET
end
client.filter(tracks: ['bitcoin']) do |object|
puts object.text if object.is_a?(Twitter::Tweet)
end
.rvm/gems/ruby-2.6.5/gems/twitter-7.0.0/lib/twitter/streaming/response.rb:24:in `on_headers_complete': Twitter::Error::NotAcceptable
According to the gem this error is raised when Twitter returns the HTTP status code 406 and according to Twitter docs 406 error code is returned when "an invalid format is specified in the request. Generally, this occurs where your client fails to properly include the headers to accept gzip encoding, but can occur in other circumstances as well." https://developer.twitter.com/en/support/twitter-api/error-troubleshooting
Please update the streams to send proper request header.
Following the documentation but get an error on streams
According to the gem this error is raised when Twitter returns the HTTP status code 406 and according to Twitter docs 406 error code is returned when "an invalid format is specified in the request. Generally, this occurs where your client fails to properly include the headers to accept gzip encoding, but can occur in other circumstances as well." https://developer.twitter.com/en/support/twitter-api/error-troubleshooting Please update the streams to send proper request header.