Skip to content
This repository was archived by the owner on Jun 8, 2023. It is now read-only.

Commit c722735

Browse files
Merge pull request #1054 from ianmurrays/developer-excuses-plugin
Adds developer excuses plugin
2 parents f2c5bae + 166f966 commit c722735

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/scripts/excuse.coffee

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Description:
2+
# Get a random developer excuse
3+
#
4+
# Commands:
5+
# hubot excuse me - Get a random developer excuse
6+
7+
# Description:
8+
# Get a random developer excuse
9+
#
10+
# Dependencies:
11+
# None
12+
#
13+
# Configuration:
14+
# None
15+
#
16+
# Commands:
17+
# hubot excuse me - Get a random developer excuse
18+
# hubot excuse - Get a random developer excuse
19+
#
20+
# Author:
21+
# ianmurrays
22+
23+
module.exports = (robot) ->
24+
robot.respond /excuse(?: me)?/i, (msg) ->
25+
robot.http("http://developerexcuses.com")
26+
.get() (err, res, body) ->
27+
matches = body.match /<a [^>]+>(.+)<\/a>/i
28+
29+
if matches and matches[1]
30+
msg.send matches[1]

0 commit comments

Comments
 (0)