okada-takuya / nomnichi_bot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nomrat

nomrat

What is nomrat?

nomrat tweets us who is expected to write a new nomnichi blog article as a reminder.

Nomnichi is a blog of nomura-laboratory’s students. (http://www.swlab.cs.okayama-u.ac.jp/lab/nom/nomnichi)

Features

  1. Remind next nomnichi author
  2. Inform today’s weather in Okayama
  3. Inform kinro (TV show) title
  4. Remind group schedule

Install for developers:

  1. Install rbenv + ruby-build (see https://github.com/sstephenson/rbenv#basic-github-checkout for details)
    $ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
    $ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
    # Edit your shell dot files to add some path and environment variables.
        
  2. Install Latest Ruby and bundler
    # Install ruby 2.1.2
    $ rbenv install 2.1.2
    
    # Installation check
    $ rbenv global 2.1.2
    $ ruby -v # -> You will see: ruby 2.1.2...
    
    # Install bundler for your new Ruby
    $ gem install bundler
    
    # Get back to your sytem default Ruby if you want
    $ rbenv global system # say, /usr/bin/ruby
    $ ruby -v
        
  3. Clone nomrat from github
    $ git clone git@github.com:nomlab/nomrat.git ~/src/nomrat
        
  4. Set default ruby version in nomrat project
    $ cd ~/src/nomrat
    $ echo '2.1.2' > .ruby-version
    $ ruby -v # -> You will see: ruby 2.1.2...
        
  5. Install requied gem packages in sandbox ~/src/nomrat/vendor/bundle
    $ cd ~/src/nomrat
    $ bundle install --path vendor/bundle
        
  6. Place OAuth credentials as _twitter_auth.stg
    # This file is expected to contain four lines:
    $ cat ~/src/nomrat/_twitter_auth.stg
    consumer_key
    consumer_secret
    access_token
    access_token_secret
        
  7. Check if nomrat is alive.
    $ ~/src/nomrat/bin/nomrat TEST
        

You may add ~/src/nomrat/bin directory to your $PATH for dogfooding

Setup

To use nomrat, you need to setup:

  1. Twitter credencial as _twitter_auth.stg
  2. Redmine credential as _redmine_mail.stg

Basic Usage

nomnichi_bot [--slack] [--debug] [--test] [MESSAGE]
 --slack: send MESSAGE to slack instead of Twitter
 --debug: show debug message to STDERR
 --test:  show message in STDOUT, not actually send to the net

nomnichi_bot tweets some nomlab-related info gathered from the net. It also prepends the MESSAGE before the info, if MESSAGE is set.

nomrat server [--port=NUMBER]
 --port: socket port number on which waiting the incoming web hooks
 --debug: show debug message to STDERR

nomrat receive incomming web-hooks from Slack or Github, and respond or inform them to a specific Slack channel.

About


Languages

Language:Ruby 100.0%