Comments (4)
Oh! I should mention that if I do heroku run irb
, load my bot, and call bot.tweet(bot.model.make_statement)
manually, it'll post a tweet like usual.
from twitter_ebooks.
This would cause the bot to have a chance of tweeting once on startup. If you want the bot to tweet regularly you'll want a separate section in the behaviors to define that schedule. See the ebooks example: https://github.com/mispy/ebooks_example
On Jan 18, 2015, at 10:57 PM, David Celis [email protected] wrote:
Hey; I'm on the latest version of twitter_ebooks. I have my bot running on Heroku, and it doesn't seem to be tweeting. My on_startup usually looks like this:
def on_startup
90% chance to make a tweet in any hour
if rand > 0.9
tweet(model.make_statement)
end
end
My bot hasn't written its own tweet in almost two weeks. This started right about the time I upgraded to the latest major version of twitter_ebooks. To debug, I removed the conditional statement. So, after deploys, my bot should be immediately tweeting. But it isn't. A quick call of heroku logs also shows no errors. Only that my bot is streaming tweets. This makes me think there might be something up with the on_startup method... Any thoughts?—
Reply to this email directly or view it on GitHub.
from twitter_ebooks.
Sorry! That was a mistake in my example... I should have just copied and pasted:
def on_startup
# 10% chance to tweet something in any 60 minute interval
scheduler.every '1h' do
if rand > 0.90
tweet(model.make_statement)
end
end
end
For my test I removed both the scheduler and if
conditional, expecting it to make a tweet on startup, but it doesn't. So, to clarify... The following does not produce a tweet on startup like would be expected:
def on_startup
tweet(model.make_statement)
end
from twitter_ebooks.
I found the issue. on_startup
is fired by calling prepare
on the bot, which I wasn't doing.
from twitter_ebooks.
Related Issues (20)
- Stopword = never tweet? HOT 2
- JSON exception when archiving HOT 2
- Bot is building sentences but not tweeting HOT 2
- Mention reply breaks Twitter limit HOT 3
- pictweet() causes TypeError HOT 3
- Heroku-specific error HOT 1
- http and https always top keyword list HOT 3
- Bot stops reacting to mentions and messages HOT 6
- Problem when trying to tweet with mentions enabled HOT 2
- Any way to consume multiple files to the same model? HOT 3
- json HOT 1
- cannot determine timezone from nil (ebooks start) HOT 1
- Error occurring upon running `ebooks start`
- Add ability to archive tweets using hashtag
- Unable to auth when running Ebooks in Supervisor
- Twitter:Error:Unauthorized HOT 1
- Fobidden words HOT 1
- cant able to stop ebooks if running in backgroud HOT 1
- requires ruby-dev but does not say so
- Twitter::Error::Unauthorized HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twitter_ebooks.