This repository has been archived by the owner on Mar 31, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from cflee/cleanup-scripts
Cleanup scripts
- Loading branch information
Showing
11 changed files
with
257 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Description: | ||
# Watch your language! | ||
# | ||
# Dependencies: | ||
# None | ||
# | ||
# Configuration: | ||
# None | ||
# | ||
# Commands: | ||
# | ||
# Author: | ||
# whitman, jan0sch | ||
|
||
module.exports = (robot) -> | ||
|
||
words = [ | ||
'arsch', | ||
'arschloch', | ||
'arse', | ||
'ass', | ||
'bastard', | ||
'bitch', | ||
'bugger', | ||
'bollocks', | ||
'bullshit', | ||
'cock', | ||
'cunt', | ||
'damn', | ||
'damnit', | ||
'depp', | ||
'dick', | ||
'douche', | ||
'fag', | ||
'fotze', | ||
'fuck', | ||
'fucked', | ||
'fucking', | ||
'kacke', | ||
'piss', | ||
'pisse', | ||
'scheisse', | ||
'schlampe', | ||
'shit', | ||
'wank', | ||
'wichser' | ||
] | ||
regex = new RegExp('(?:^|\\s)(' + words.join('|') + ')(?:\\s|\\.|\\?|!|$)', 'i'); | ||
|
||
robot.hear regex, (msg) -> | ||
msg.send 'You have been fined one credit for a violation of the verbal morality statute.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Description: | ||
# Gorbypuff Thunderstone | ||
# | ||
# Dependencies: | ||
# None | ||
# | ||
# Configuration: | ||
# None | ||
# | ||
# Commands: | ||
# gorby - Display a picture of everyone's favorite flat-faced cat | ||
# | ||
# Author: | ||
# bradly | ||
|
||
gorbies = [ | ||
"http://24.media.tumblr.com/ded6b610059bac9203432ae1999fb439/tumblr_mix1ntHwN21rt6kj7o1_1280.jpg", | ||
"http://25.media.tumblr.com/4eaabf5111c8444e68208adaa22c1c3a/tumblr_mewmgwxzZA1rt6kj7o1_1280.jpg", | ||
"http://24.media.tumblr.com/tumblr_me3ubx13ck1rt6kj7o1_1280.jpg", | ||
"http://25.media.tumblr.com/tumblr_md5v15WAWI1rt6kj7o1_1280.jpg", | ||
"http://25.media.tumblr.com/tumblr_mcbxaz9w7T1rt6kj7o1_1280.jpg", | ||
"http://25.media.tumblr.com/tumblr_mbqotcRr4j1rt6kj7o1_1280.jpg", | ||
"http://25.media.tumblr.com/tumblr_m99wdgHcNN1rt6kj7o1_1280.jpg", | ||
"http://25.media.tumblr.com/tumblr_m94zjtC4sy1rt6kj7o1_1280.jpg", | ||
"http://25.media.tumblr.com/tumblr_m8cju4aFeS1rt6kj7o1_1280.png", | ||
"http://25.media.tumblr.com/tumblr_m7a3unqPjr1rt6kj7o1_1280.jpg", | ||
"http://25.media.tumblr.com/tumblr_m6lev83Gak1rt6kj7o1_1280.png", | ||
"http://25.media.tumblr.com/tumblr_m6leq7NrsY1rt6kj7o1_1280.png", | ||
"http://25.media.tumblr.com/tumblr_m5vy9hfcTs1rt6kj7o1_1280.png", | ||
"http://25.media.tumblr.com/tumblr_m5g0bmkl601rt6kj7o1_1280.png", | ||
"http://25.media.tumblr.com/tumblr_m5g0ab3EiH1rt6kj7o1_1280.png", | ||
"http://25.media.tumblr.com/tumblr_m51suk3wfS1rt6kj7o1_1280.png", | ||
"http://25.media.tumblr.com/tumblr_m50tx5IWhJ1rt6kj7o1_1280.png", | ||
"http://24.media.tumblr.com/tumblr_m4q48mVFXj1rt6kj7o1_1280.png", | ||
"http://24.media.tumblr.com/tumblr_m4hxmurzlL1rt6kj7o1_1280.png", | ||
"http://25.media.tumblr.com/tumblr_m4hxioPUln1rt6kj7o1_1280.png", | ||
"http://25.media.tumblr.com/tumblr_m4gqg94kSA1rt6kj7o1_1280.png", | ||
"http://25.media.tumblr.com/tumblr_m4c9ncT0LM1rt6kj7o1_1280.png", | ||
"http://24.media.tumblr.com/tumblr_m44m5g6m001rt6kj7o1_1280.png", | ||
"http://25.media.tumblr.com/tumblr_m3v8keZVhR1rt6kj7o1_1280.png", | ||
"http://24.media.tumblr.com/tumblr_m3k8rvS6Uq1rt6kj7o1_1280.png", | ||
"http://25.media.tumblr.com/tumblr_m3k88eKJQf1rt6kj7o1_1280.png", | ||
"http://25.media.tumblr.com/tumblr_m3elppeyqa1rt6kj7o1_1280.png", | ||
"http://25.media.tumblr.com/tumblr_m3ekqyJ1iy1rt6kj7o1_1280.png", | ||
"http://24.media.tumblr.com/tumblr_m35xkkGbKO1rt6kj7o1_1280.png", | ||
"http://24.media.tumblr.com/tumblr_m305ndXRNH1rt6kj7o1_1280.png", | ||
"http://25.media.tumblr.com/tumblr_m2v55jdLgV1rt6kj7o1_500.png", | ||
"http://25.media.tumblr.com/tumblr_m2ro01h07O1rt6kj7o1_1280.png", | ||
"http://25.media.tumblr.com/tumblr_m2olbl9Uw61rt6kj7o1_1280.png", | ||
"http://25.media.tumblr.com/tumblr_m2n4grjjN51rt6kj7o1_1280.png", | ||
"http://24.media.tumblr.com/tumblr_m2j8mhAuMm1rt6kj7o1_1280.png", | ||
"http://24.media.tumblr.com/tumblr_m2i8utX5Qv1rt6kj7o1_1280.png", | ||
"http://24.media.tumblr.com/tumblr_m2i85ws1561rt6kj7o1_1280.png", | ||
"http://24.media.tumblr.com/tumblr_m288synRIj1rt6kj7o1_1280.png", | ||
"http://24.media.tumblr.com/tumblr_m21kfe7zir1rt6kj7o1_400.png", | ||
"http://25.media.tumblr.com/tumblr_m21hprOGO71rt6kj7o1_1280.png", | ||
"http://24.media.tumblr.com/tumblr_m21gc84uY21rt6kj7o1_1280.png" | ||
] | ||
|
||
module.exports = (robot) -> | ||
robot.hear /gorby|puff|thunderhorse/i, (msg) -> | ||
msg.send msg.random gorbies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Description: | ||
# Load a random Grumpy Cat from an array of images. | ||
# Based on pugme. | ||
# | ||
# Dependencies: | ||
# None | ||
# | ||
# Configuration: | ||
# None | ||
# | ||
# Commands: | ||
# hubot grumpycat me - Receive a Grumpy Cat | ||
# hubot grumpycat bomb N - get N Grumpy Cats | ||
# | ||
# Author: | ||
# trey | ||
|
||
cats = [ | ||
"http://mlkshk.com/r/M6EO.gif", # rabbit in a hat | ||
"http://mlkshk.com/r/M17S.gif", # dress | ||
"http://mlkshk.com/r/M15O.gif", # le mis | ||
"http://mlkshk.com/r/M01A.gif", # cartoons | ||
"http://mlkshk.com/r/LZ7U.gif", # fuck this | ||
"http://mlkshk.com/r/LXP2.gif", # grumpy tardar sauce | ||
"http://mlkshk.com/r/LWNG.gif", # grandma got run over | ||
"http://mlkshk.com/r/LVVR.gif", # double deal with it | ||
"http://mlkshk.com/r/LV0S.gif", # mural | ||
"http://mlkshk.com/r/LUYE.gif", # stahp | ||
"http://mlkshk.com/r/LUO2.gif", # good | ||
"http://mlkshk.com/r/LS6R.gif", # shut the fuck up | ||
"http://mlkshk.com/r/LSWD.gif", # Tardar Bonepart | ||
"http://mlkshk.com/r/LPCN.gif", # drawing | ||
"http://mlkshk.com/r/LLVD.gif", # terrible time of the year | ||
"http://mlkshk.com/r/LKTG.gif", # Citizen Kane | ||
"http://mlkshk.com/r/LEF8.gif", # emotions | ||
"http://mlkshk.com/r/LEFR.gif", # skate deck | ||
"http://mlkshk.com/r/L337.gif", # look askance | ||
"http://mlkshk.com/r/KV8K.gif", # sitting | ||
"http://mlkshk.com/r/KU1S.gif", # 3 grump moon | ||
"http://mlkshk.com/r/KRBA.gif", # rabbit painting | ||
"http://mlkshk.com/r/KL19.gif" # lying on the ground | ||
] | ||
|
||
module.exports = (robot) -> | ||
robot.respond /grumpycat me/i, (msg) -> | ||
msg.send cats[Math.floor(Math.random()*cats.length)] | ||
|
||
robot.respond /grumpycat bomb( (\d+))?/i, (msg) -> | ||
count = msg.match[2] || 5 | ||
for i in [1..count] by 1 | ||
msg.send cats[Math.floor(Math.random()*cats.length)] | ||
|
||
robot.respond /how many grumpycats are there/i, (msg) -> | ||
msg.send "There are #{cats.length} grumpycats." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Description: | ||
# Evaluate one line of Ruby script | ||
# | ||
# Dependencies: | ||
# None | ||
# | ||
# Configuration: | ||
# None | ||
# | ||
# Commands: | ||
# hubot ruby|rb <script> - Evaluate one line of Ruby script | ||
# | ||
# Author: | ||
# jingweno | ||
|
||
module.exports = (robot) -> | ||
robot.respond /(ruby|rb)\s+(.*)/i, (msg)-> | ||
script = msg.match[2] | ||
|
||
msg.http("http://tryruby.org/levels/1/challenges/0") | ||
.query("cmd": script) | ||
.headers("Content-Length": "0") | ||
.put() (err, res, body) -> | ||
switch res.statusCode | ||
when 200 | ||
result = JSON.parse(body) | ||
|
||
if result.success | ||
msg.reply result.output | ||
else | ||
msg.reply result.result | ||
else | ||
msg.reply "Unable to evaluate script: #{script}. Request returned with the status code: #{res.statusCode}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Description: | ||
# Make sure that hubot shares the ruby rules. | ||
# | ||
# Commands: | ||
# hubot the ruby rules - Make hubot explain how to write practical ruby. | ||
# | ||
# Notes: | ||
# These rules were provided by Sandy Metz in the Ruby Rouges podcast: | ||
# http://rubyrogues.com/087-rr-book-clubpractical-object-oriented-design-in-ruby-with-sandi-metz/ | ||
|
||
rubyRules = [ | ||
"1. Your class can be no longer than 100 lines of code.", | ||
"2. Your methods can be no longer than 5 lines of code.", | ||
"3. You can pass no more than 4 parameters and you can’t just make it one big hash.", | ||
"4. In your rails controller, you can only instantiate 1 object to do whatever it is that needs to be done.", | ||
"5. Your rails view can only know about 1 instance variable", | ||
"6. You can break these rules if you can explain to your pair or in your pull request why it makes sense." | ||
] | ||
|
||
module.exports = (robot) -> | ||
robot.respond /(what are )?the ruby (rules|laws)/i, (msg) -> | ||
msg.send rubyRules.join('\n') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Description: | ||
# Find a rubygem from rubygems.org | ||
# | ||
# Dependencies: | ||
# None | ||
# | ||
# Configuration: | ||
# None | ||
# | ||
# Commands: | ||
# hubot there's a gem for <that> - Returns a link to a gem on rubygems.org | ||
# | ||
# Author: | ||
# sferik | ||
|
||
module.exports = (robot) -> | ||
robot.respond /there's a gem for (.*)/i, (msg) -> | ||
search = msg.match[1] | ||
msg.http('https://rubygems.org/api/v1/search.json') | ||
.query(query: search) | ||
.get() (err, res, body) -> | ||
results = JSON.parse(body) | ||
gems=[] | ||
for result in results[0..4] | ||
gems.push "#{result.name}: https://rubygems.org/gems/#{result.name}" | ||
if gems.length>0 then msg.send gems.join('\n') else msg.send "Actually, there isn't a gem for that!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters