From 971c676efed82ead7e56b7cf39f9437dd7324c88 Mon Sep 17 00:00:00 2001 From: Enrico Fasoli Date: Fri, 28 Aug 2015 17:58:22 +0000 Subject: [PATCH] aggiunti dank maymays e http cat --- scripts/memes.coffee | 16 ++++++++++++++++ scripts/statuscodes.coffee | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 scripts/memes.coffee create mode 100644 scripts/statuscodes.coffee diff --git a/scripts/memes.coffee b/scripts/memes.coffee new file mode 100644 index 0000000..678001f --- /dev/null +++ b/scripts/memes.coffee @@ -0,0 +1,16 @@ +# Description: +# makes dank maymays +# +# Commands: +# hubot meme template/upper-title/lower-title +# +# Configuration: +# None +# +# Author: +# Enrico Fasoli (fazo96) + +module.exports = (robot) -> + robot.respond /meme (.+)/i, (res) -> + url = 'http://memegen.link/'+res.match[1]+'.jpg' + res.send url diff --git a/scripts/statuscodes.coffee b/scripts/statuscodes.coffee new file mode 100644 index 0000000..613f329 --- /dev/null +++ b/scripts/statuscodes.coffee @@ -0,0 +1,18 @@ +# Description: +# posta codici di stato +# +# Commands: +# hubot (statuscode) +# +# 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'