https://github.com/coolprobn/ruby-twitter-bot
Twitter bot which retweets #rails and #ruby hashtags (case insensitive). Developed with Ruby.
https://github.com/coolprobn/ruby-twitter-bot
ruby twitter-bot
Last synced: 5 months ago
JSON representation
Twitter bot which retweets #rails and #ruby hashtags (case insensitive). Developed with Ruby.
- Host: GitHub
- URL: https://github.com/coolprobn/ruby-twitter-bot
- Owner: coolprobn
- License: mit
- Created: 2020-10-31T12:19:05.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-07-01T07:39:24.000Z (almost 4 years ago)
- Last Synced: 2025-07-13T01:34:03.373Z (11 months ago)
- Topics: ruby, twitter-bot
- Language: Ruby
- Homepage: https://twitter.com/ruby_rails_bot
- Size: 17.6 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ruby-twitter-bot
Twitter bot which retweets #rails and #ruby hashtags (case insensitive). Developed with Ruby.
# Run the bot
1. Install dependencies
`bundle install`
2. Copy `config/application.yml` from `config/application.yml.sample` and add all required values that you get from Twitter Api configs
3. Run the bot from project root
`ruby app/services/twitter/re_tweet_service.rb`
4. 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`
5. 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](https://stackoverflow.com/a/6391255/9359123)
**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
# TODO
1. Allow to update the hashtags from `application.yml`.
2. Create initializer file and add gem require and figaro config to it.