asjon/scripts/statuscodes.coffee
2015-09-26 17:26:09 +02:00

19 lines
378 B
CoffeeScript

# Description:
# posta codici di stato
#
# Commands:
# hubot <statuscode> - mostra un http status cat
#
# Configuration:
# None
#
# Author:
# Enrico Fasoli (fazo96)
module.exports = (robot) ->
robot.respond /([0-9]{3})$/i, (res) ->
n = parseInt res.match[1]
if n < 100 or n > 599
res.match[1] = "404"
res.send 'http://http.cat/'+res.match[1]+'.jpg'