An IRC Bot and Website for 5by5.tv written with the Cinch and Sinatra frameworks
Ruby CSS JavaScript HTML CoffeeScript
Latest commit ab1cd6f Mar 24, 2016 @rikai rikai Update readme.md
Permalink
Failed to load latest commit information.
config Untested backup.rb changes. May 9, 2013
db db folder now included in repo Aug 21, 2012
images Shrank width of arrow sprite Jan 5, 2012
lib Can't use the i18n alias in models, apparently. Feb 9, 2014
locales i18n-ify the web side of things. May 12, 2013
log Added empty log folder Aug 23, 2012
pid Including empty pid folder for development Aug 23, 2012
public style: remove console logs Apr 18, 2013
sass Sayonara whitespace and line ending problems Apr 18, 2013
scripts Sayonara whitespace and line ending problems Apr 18, 2013
test Better error messages for missing titles and users Apr 19, 2012
views Whoops, use the correct i18n here. Feb 9, 2014
.gitignore Fixes environment and twitter Apr 17, 2013
.powrc Update to use .ruby_version May 9, 2013
.ruby-version Add a .ruby-version Feb 9, 2014
.ruby_version Update to use .ruby_version May 9, 2013
Gemfile Update the gemfile. Feb 9, 2014
Gemfile.lock Whoops, these don't belong in this version! Feb 9, 2014
Procfile Remove freenode references May 8, 2013
Procfile.local Get rid of hardcoded development port; Readme.md update May 12, 2013
Rakefile Add db seed task Apr 17, 2013
cinchize.yml Update cinchize.yml wording Feb 9, 2014
config.ru Modernize project Dec 22, 2011
console Console command for quick invocation Jan 5, 2012
environment.rb Merge remote-tracking branch 'refs/remotes/origin/master' into pr/55 Mar 24, 2016
license Added MIT license to the project, the king of all licenses. Jun 4, 2011
readme.md Update readme.md Mar 24, 2016
showbot_irc.rb Sayonara whitespace and line ending problems Apr 18, 2013
showbot_web.rb Refactored word cloud rendering javascript Apr 18, 2013

readme.md

Showbot

Dead as of 2013-10-16, the main project is now located at rikai/Showbot

A sweet IRC bot with a web interface for 5by5. Built on cinch and sinatra.

The Creation of Showbot

IRC Commands

  • !next - When's the next live show?
  • !schedule - What shows are being recorded live in the next seven days?
  • !suggest - Be heard. Suggest a title for the live show.
  • !link - Know the link for that? Suggest it and make the show better.
  • !current - What's playing on 5by5.tv/live? I've got you covered.
  • !last_status - The last tweet by @5by5, delivered to you in IRC. Sweet.
  • !about - Was showbot coded or did it spontaneously come into existence?
  • !help - Uh, this.

Setup and Customization

Prerequisites

Setup

These commands will get you setup to run Showbot.

  • git clone https://github.com/mutewinter/Showbot.git
  • cd Showbot
  • bundle
  • foreman run rake db:migrate

Finally you need to setup your .env file in the root of the project. At the bare minimum you'll need the following:

# Bot lib folder
RUBYLIB=./lib

# Set this if you want to use a language other than english.
# You will also need to create a corresponding .yml file in the locales folder.
SHOWBOT_LOCALE=en

# Foreman stuff
## Production port
PORT=80
## Development port
DEVELOPMENT_PORT=5000

# Point this to the url of data.json, if you have one
SHOWBOT_DATABASE_URL=your_info_here

# For backup.rb
BOT_DATABASE_NAME=your_info_here
BOT_DATABASE_USER=your_info_here
BOT_DATABASE_PASSWORD=your_info_here
BOT_DATABASE_HOST=your_info_here
BOT_DATABASE_PORT=your_info_here
BOT_DATABASE_OPTS=your_info_here
S3_ACCESS_KEY_ID=your_info_here
S3_SECRET_ACCESS_KEY=your_info_here
S3_REIGON=your_info_here
S3_BUCKET=your_info_here
S3_PATH=your_info_here
S3_KEEP=your_info_here

# Point this to the url of data.json, if you have one
DATA_JSON_URL=your_info_here

Configuring IRC

data.json

data.json is a file served specifically by 5by5.tv that indicates which show is live. It is currently integrated with title suggestions so that the currently playing show is fetched and saved in the database when a title is suggested.

If you want to remove the functionality provided by data.json, you will need to start by removing the before create hook in suggestion.rb. To avoid the "Show Not Listed" message you'll want to remove the suggestion set break in _table_set.haml and _bubble_set.haml.

Modifying the CSS

Modifying showbot.scss requires that you start the rake sass:watch command. While this command is running, public/showbot.css will be overwritten with any changes that are made in showbot.scss. This annoying setup is necessary due to Bourbon not working well outside of the Rails asset pipeline.

Data.json

5by5.tv uses a JSON API to provide details about which show is live. When a title is suggested, this JSON API is queried and the show that the title was suggested during is attached to the suggestion.

The format of 5by5.tv's JSON is as follows:

  {
    'live': true,
    'broadcast': {
      'slug': 'show_slug_here'
    }
  }

The 'show_slug_here' is the value read and attached to the title suggestion.

Launching Showbot

Website and the IRC Bot

$ bundle exec foreman start -f Procfile.local

Just the Website

$ bundle exec foreman start web -f Procfile.local

Just the IRC Bot

$ bundle exec foreman start irc -f Procfile.local

Special Thanks

  • Special thanks to Rikai for reverse-engineering the setup steps for someone setting up Showbot from scratch.
  • To gouwens for implementing the clustered view.

License

The MIT License

Copyright (c) 2011 Jeremy Mack, Pile of Turtles, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

sekret analytics shhh