Skip to content

Commit

Permalink
dilbert: fix regex, add comment for /help
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalonzo committed Dec 4, 2011
1 parent 200b8cb commit 43a8265
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/scripts/dilbert.coffee
@@ -1,7 +1,11 @@
# Dilbert
#
# show me dilbert - gets the daily dilbert

htmlparser = require "htmlparser"

module.exports = (robot) ->
robot.respond /(show( me)?|fetch ( me)? )?dilbert/i, (msg) ->
robot.respond /((show|fetch)( me )?)?dilbert/i, (msg) ->
dilbertRss msg, (url) ->
msg.send url

Expand All @@ -14,6 +18,6 @@ dilbertRss = (msg, cb) ->
item = dom.items[0]
match = item.description.match(dilbertRegexp)
cb match[1] if match

parser = new htmlparser.Parser(handler)
parser.parseComplete(body)

0 comments on commit 43a8265

Please sign in to comment.