Skip to content
This repository has been archived by the owner on Jun 25, 2018. It is now read-only.

Possibly PEBCAK issue #32

Closed
mattstratton opened this issue Oct 31, 2014 · 4 comments
Closed

Possibly PEBCAK issue #32

mattstratton opened this issue Oct 31, 2014 · 4 comments

Comments

@mattstratton
Copy link

I have generated the model, and added in all the auth stuff in my generated bot. But when I run
ruby run.rb
it all fires up just fine, but nothing ever happens. I'm fairly certain it doesn't actually connect to twitter, either, as I replace the keys, secrets, and tokens with gibberish (or even completely comment them out) and it still fires up without error.

I'm sure I'm missing something here. My steps:

  1. Create app under the twitter account that will be my bot (let's call it 'mattbot' - NOTE: That is NOT the real account name)
  2. Ensure that the app has r/w/dm rights. Generate oauth token for mattbot under that app
  3. Run ebooks new mattbot to create the new repo
  4. Edit the bots.rb in the mattbot repo to put in all the keys, secrets, tokens, et al
  5. Uncomment out a few handlers in bots.rb:
  bot.on_mention do |tweet, meta|
    # Reply to a mention
    bot.reply(tweet, meta[:reply_prefix] + "oh hullo")
  end

  bot.on_timeline do |tweet, meta|
    # Reply to a tweet in the bot's timeline
    bot.reply(tweet, meta[:reply_prefix] + "nice tweet")
  end
  1. Within the mattbot repo, enter ruby run.rb
 ~/src/mattbot/ [master] ruby run.rb
Faraday::Builder is now Faraday::RackBuilder.
@mattbot: starting stream for petechesbot
@mattbot: Online!
  1. Attempt to reply to mattbot on twitter
  2. Nothing happens
  3. Edit bots.rb and comment out all lines with secret keys, etc
  4. Attempt to ruby run.rb again
  5. Same result

What am I missing?

_For the record, I tried this all by pushing it to heroku first, with much the same result. I switched back to running ruby run.rb locally for efficiency of troubleshooting_

@rabbitmaiden
Copy link

Did you verify your bot's account email? Twitter will not let API activity happen until you do so.

@mattstratton
Copy link
Author

I will double check. It does work from Tweetbot so I assume API activity is functional. 

@mattstratton
Copy link
Author

OK, email address was verified. I determined the same behavior if I basically clone down https://github.com/mispy/ebooks_example and replace it with my own data.

The bit I'm wondering has to do with the Oauth token - on the twitter apps page, this is now referred to as "Your Access Token" - I presume that is the same token referred to?

@mattstratton
Copy link
Author

OK. It is working after all. That is, I can see the bot generating tweets (well, it did it twice). It doesn't seem to interact with @ replies, but that's a problem for another day.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants