Twitter bot which retweets #rails and #ruby hashtags (case insensitive). Developed with Ruby.
-
Install dependencies
bundle install
-
Copy
config/application.yml
fromconfig/application.yml.sample
and add all required values that you get from Twitter Api configs -
Run the bot from project root
ruby app/services/twitter/re_tweet_service.rb
-
You can change the hashtags you want the bot to retweet from inside
app/services/twitter/re_tweet_service.rb
- Update constant
HASHTAGS_TO_WATCH
- Update constant
-
Run bot in background
# Create a new shell $ screen -S twitter-bot # Run the twitter bot (you should be inside project root) $ ruby app/services/twitter/re_tweet_service.rb # Detach ruby bot and move to original screen $ CTRL + a + d # Return to the screen where bot is running $ screen -r twitter-bot
Ref: Run Ruby script in the background
NOTE: If you have deployed bot to remote server, you need to restart the bot after server restart because it kills the script running in background
- Allow to update the hashtags from
application.yml
. - Create initializer file and add gem require and figaro config to it.