Giter Site home page Giter Site logo

Comments (9)

muffinista avatar muffinista commented on July 18, 2024

Hey, can you give me an idea of exactly when this happens? Also, does it happen consistently, etc? And a full backtrace might be helpful. Thanks!

from chatterbot.

Corstiaan84 avatar Corstiaan84 commented on July 18, 2024

Hey, yes it happens consistently. Here's the trace: https://gist.github.com/Corstiaan84/c70324d47c9fb129a512

Thanks!

from chatterbot.

muffinista avatar muffinista commented on July 18, 2024

Sorry for the delay. Are you able to post the code for your bot, with credentials/etc removed? If you want you can email it to me -- colin at muffinlabs dot com

from chatterbot.

wr avatar wr commented on July 18, 2024

I'm experiencing the same error when using the Streaming API:

2016-01-07T18:52:00.540179+00:00 app[worker.1]:     from /app/vendor/bundle/ruby/2.0.0/gems/chatterbot-1.0.1/lib/chatterbot/streaming.rb:23:in `do_streaming'
2016-01-07T18:52:00.540199+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.0.0/gems/twitter-5.14.0/lib/twitter/rest/response/raise_error.rb:15:in `on_complete': Could not authenticate you. (Twitter::Error::Unauthorized)

(rest of the trace here: https://gist.github.com/wr/e787cf8ee4c08972c7bb)

Happens consistently – but chatterbot works fine when using the non-streaming APIs with the exact same credentials.

Using the sample code here:

#
# run a search
#
streaming(endpoint:"search") do
    search("Streaming API") do |tweet|
      puts tweet.text
    end
end

from chatterbot.

muffinista avatar muffinista commented on July 18, 2024

OK, I think you might need to try this:

streaming(endpoint: :filter) do
  search("Streaming API") do |tweet|
    puts tweet.text
  end
end

(note the different endpoint).

This functionality has changed a bit in the next version of the gem but I haven't released a new version quite yet, but you can also try running against the master branch of git if that's an option for you.

from chatterbot.

Corstiaan84 avatar Corstiaan84 commented on July 18, 2024

@muffinista, your solutions seems to work :-).

However, when running this:

streaming(endpoint: :filter) do
    search("obama") do |tweet|
      puts tweet.text
    end
end

this is the output of the stream:

#<Twitter::Tweet:0x007f8c9a567ab0>
RT @cbatson941: DEAR OBAMA: DAY 7 OF OPEN CARRY IN TEXAS. NO SHOOTOUTS IN STREETS. CAN YOU SAY THE SAME ABOUT YOUR HOMETOWN?
#<Twitter::Tweet:0x007f8c9a565f80>
#<Twitter::Tweet:0x007f8c9a564298>
#<Twitter::Tweet:0x007f8c9a56f148>
#<Twitter::Tweet:0x007f8c9a56c380>
RT @nice_mustard: 2017: obama has taken all the guns. i trudge through a desolate hellscape of alive unshot people. "WHY???" i scream at a …
#<Twitter::Tweet:0x007f8c9a9bb0d0>
@SchneiderSTLMO It's offensive trying to blame good citizens for evil gun actions! I find Obama offensive period &amp; his agenda tooβ™‘
#<Twitter::Tweet:0x007f8c9a9b83f8>
#<Twitter::Tweet:0x007f8c9c2b6f58>
@TXhighplains @theblaze He gets contempt for using the N word but Moochelle Obama openly says white people is what's wrong with America.
#<Twitter::Tweet:0x007f8c9c2b42f8>
RT @princesssnena: Can Obama jus stay president again? πŸ˜‚
#<Twitter::Tweet:0x007f8c9a9c5a80>
#<Twitter::Tweet:0x007f8c9bbe3d48>
#<Twitter::Tweet:0x007f8c9a57e800>
#<Twitter::Tweet:0x007f8c9a585b78>
#<Twitter::Tweet:0x007f8c9a58f538>
RT @nice_mustard: 2017: obama has taken all the guns. i trudge through a desolate hellscape of alive unshot people. "WHY???" i scream at a …
#<Twitter::Tweet:0x007f8c9a58c3b0>
#<Twitter::Tweet:0x007f8c9a9d2fc8>
Kerry says #NorthKorea was never less unattended by Obama foreign policy, says his spox will take all Qs on it
#<Twitter::Tweet:0x007f8c9a9d12e0>
#<Twitter::Tweet:0x007f8c9a595488>

Is is correct that I am not see the text of every tweet?

from chatterbot.

wr avatar wr commented on July 18, 2024

seems to work for me as well :)

from chatterbot.

muffinista avatar muffinista commented on July 18, 2024

There's a few possibilities here:

  • I think this version chatterbot skips retweets by default, but it will instantiate the tweet before deciding to reject it
  • If you have a blacklist in place, those tweets will also be instantiated but skipped.

If it seems like something else, let me know, but probably under a new issue, since I think we solved this one. Thanks!

from chatterbot.

Corstiaan84 avatar Corstiaan84 commented on July 18, 2024

Seems legit :-)

from chatterbot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.