Slack Bot Rootme
Description
A Slack bot to display root-me ranking of the team members.
Commands
rootme
: without command, the default is to print a help messagerootme ranking
: display the ranking of all the users registeredrootme add slack_pseudo rootme_pseudo
: register a user for the rankingslack_pseudo
: pseudo of the user on Slackrootme_pseudo
: pseudo of that same user on root-me.org
rootme remove slack_pseudo
: stop following a user
Setup
On slack.com
- create a Slack bot here, choose
rootme
for the name - note the API token
- optionnal: in the "Customize Icon" section, click "Choose an emoji" and select
:skull_and_crossbones:
, it's similar to root-me.org's icon
On your server
- clone this repository on your server
- run
bundle install
to install dependencies - run the bot:
SLACK_API_TOKEN=[YOUR TOKEN HERE] bundle exec ruby app/rootmebot.rb
In your Slack client
- invite the bot in the channel you want it in:
/invite rootme
- you can now send commands to the bot! See "Commands" section above.
Technical details
Uses the gem slack-ruby-bot.
Unfortunately, root-me.org doesn't provide an API, so the data is found with HTML parsing.
TODO
- update scores of users after a delay
- add unit tests
- a command to display the last challenges validations of a user (for example all the validations made during the last 7 days)
License
GPL