mispy-archive / twitter_ebooks

Better twitterbots for all your friends~
MIT License
972 stars 140 forks source link

Bot is building sentences but not tweeting #125

Closed spazz22 closed 8 years ago

spazz22 commented 8 years ago

Hi - I'm quite new to this bot and I think I've nearly got it working.

The problem I'm having is that the bot only seems to build sentences/statements on my configured schedule; however, it never seems to actually tweet anything. Code in question and output produced is below. Any thoughts?

Code in question:

def on_startup load_model!

scheduler.every '1m' do
  puts "I'M HERE NOW"
  statement = model.make_statement(140)
  puts "ABOUT TO TWEET"
  tweet(statement)
  puts "SHOULD HAVE TWEETED"
end

end

Output produced: pi@raspberrypi:~/tBot/testBot $ sudo ebooks start @handle: User information updated @handle: Loading model model/testuser.model @handle: starting tweet stream @handle: Online! I'M HERE NOW Building: sentence 0 of 90911 Building: sentence 10000 of 90911 Building: sentence 20000 of 90911 Building: sentence 30000 of 90911 Building: sentence 40000 of 90911 Building: sentence 50000 of 90911 Building: sentence 60000 of 90911 Building: sentence 70000 of 90911 Building: sentence 80000 of 90911 Building: sentence 90000 of 90911 'M HERE NOW Building: sentence 0 of 90911 Building: sentence 10000 of 90911 Building: sentence 20000 of 90911 Building: sentence 30000 of 90911 Building: sentence 40000 of 90911 Building: sentence 50000 of 90911 Building: sentence 60000 of 90911 Building: sentence 70000 of 90911 Building: sentence 80000 of 90911 Building: sentence 90000 of 90911

spazz22 commented 8 years ago

I've modified the code and have had some success getting the bot to tweet; however it is only working intermittently:

def on_startup load_model! scheduler.every '1m' do puts "I'M HERE NOW"

statement = model.make_statement(140)

  tweet(model.make_statement)
  puts "ABOUT TO TWEET"
  puts "SHOULD HAVE TWEETED"
end

end

Which now produces the following. As you can see it only tweets intermittently (schedueled to tweet every 15 minutes now) and I'm frequently hitting the "Unable to produce valid non-verbatim tweet; using " condition:

I'M HERE NOW Building: sentence 0 of 90911 Building: sentence 10000 of 90911 Building: sentence 20000 of 90911 Building: sentence 30000 of 90911 Building: sentence 40000 of 90911 Building: sentence 50000 of 90911 Building: sentence 60000 of 90911 Building: sentence 70000 of 90911 Building: sentence 80000 of 90911 Building: sentence 90000 of 90911 I'M HERE NOW Building: sentence 0 of 90911 Building: sentence 10000 of 90911 Building: sentence 20000 of 90911 Building: sentence 30000 of 90911 Building: sentence 40000 of 90911 Building: sentence 50000 of 90911 Building: sentence 60000 of 90911 Building: sentence 70000 of 90911 Building: sentence 80000 of 90911 Building: sentence 90000 of 90911 Unable to produce valid non-verbatim tweet; using " "favorite_count": 0," @handle: Tweeting ' "favorite_count": 0,' ABOUT TO TWEET SHOULD HAVE TWEETED I'M HERE NOW Building: sentence 0 of 90911 Building: sentence 10000 of 90911 Building: sentence 20000 of 90911 Building: sentence 30000 of 90911 Building: sentence 40000 of 90911 Building: sentence 50000 of 90911 Building: sentence 60000 of 90911 Building: sentence 70000 of 90911 Building: sentence 80000 of 90911 Building: sentence 90000 of 90911 I'M HERE NOW Building: sentence 0 of 90911 Building: sentence 10000 of 90911 Building: sentence 20000 of 90911 Building: sentence 30000 of 90911 Building: sentence 40000 of 90911 Building: sentence 50000 of 90911 Building: sentence 60000 of 90911 Building: sentence 70000 of 90911 Building: sentence 80000 of 90911 Building: sentence 90000 of 90911 Unable to produce valid non-verbatim tweet; using " "expanded_url":" @handle: Tweeting ' "expanded_url":' ABOUT TO TWEET SHOULD HAVE TWEETED I'M HERE NOW Building: sentence 0 of 90911 Building: sentence 10000 of 90911 Building: sentence 20000 of 90911 Building: sentence 30000 of 90911 Building: sentence 40000 of 90911 Building: sentence 50000 of 90911 Building: sentence 60000 of 90911 Building: sentence 70000 of 90911 Building: sentence 80000 of 90911 Building: sentence 90000 of 90911 I'M HERE NOW Building: sentence 0 of 90911 Building: sentence 10000 of 90911 Building: sentence 20000 of 90911 Building: sentence 30000 of 90911 Building: sentence 40000 of 90911 Building: sentence 50000 of 90911 Building: sentence 60000 of 90911 Building: sentence 70000 of 90911 Building: sentence 80000 of 90911 Building: sentence 90000 of 90911

spazz22 commented 8 years ago

Please close this issue.

I rebuild the model using a .json extension and all is working well now.

Cheers!