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'