From 7e6c60dd6117d9c3159e66298c8a7b540eb31436 Mon Sep 17 00:00:00 2001 From: Enrico Fasoli Date: Mon, 27 Apr 2015 20:56:20 +0200 Subject: [PATCH] update wolfram alpha module --- scripts/wolfram.coffee | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/wolfram.coffee b/scripts/wolfram.coffee index 1de2220..d41d1ef 100644 --- a/scripts/wolfram.coffee +++ b/scripts/wolfram.coffee @@ -4,6 +4,12 @@ # Dependencies: # "wolfram":"0.3.1" # +# Configuration: +# WOLFRAM_API_KEY - self explanatory +# +# Commands +# hubot wolfram/wfa/quanto fa/compute ... - pone la domanda a Wolfram Alpha +# # Author: # Enrico Fasoli (fazo96) # @@ -18,10 +24,7 @@ module.exports = (robot) -> res.send 'contattando Wolfram Alpha...' wolfram.query res.match[1], (err, result) -> if err then return res.send err - #res.send JSON.stringify result - parseSubPod = (subpod) -> subpod.value + parseSubPod = (subpod) -> subpod.value or subpod.image parsePod = (pod) -> '\n=== ' + pod.title + '\n' + pod.subpods.map(parseSubPod).join('\n') res.send (parsePod(pod) for pod in result).join('') - -