Skip to content

jasonwc/reddit-bot-example

Repository files navigation

Reddit Bot

An example bot for my talk at the Downtown Utah Ruby User Group

The bot responds to @reddit-bot reddit :subreddit [:hot|:new|:top|:rising|:controversial]

Branches

  • Checkout master if you want to have boiler plate and create your own commands.
  • Checkout 1-fetching if you want to see the bot grabbing things from /r/all
  • Checkout 2-subreddits if you want to see the bot grabbing things from a particular subreddit
  • Checkout 3-sorting if you want to see the bot sorting posts
  • Checkout 4-formatting if you want to see the bot formatting the messages for slack
  • Checkout 5-error-handling if you want to see the bot handling errors appropriately
  • Checkout 6-progress-indicator if you want to see the bot indicate to the user that its processing
  • Checkout 7-mvc if you want to see the bot refactored to use the MVC pattern offered by slack-ruby-bot

Quick Start

This bot assumes you have RVM installed. If you don't, its simple!

gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
\curl -sSL https://get.rvm.io | bash -s stable

Once you've installed rvm and installed the correct Ruby, run the following

git clone [email protected]:jasonwc/reddit-bot-example.git
cd reddit-bot-example
bundle install
cp .env.sample .env
# Get a Bot token from Slack and add it to you .env file
ruby run.rb

About

An example Slackbot for the Utah Ruby User Group

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages