From 35517b4e3ad15d5110c2a56a196e5cd9e619e165 Mon Sep 17 00:00:00 2001 From: Enrico Fasoli Date: Thu, 23 Apr 2015 17:38:28 +0200 Subject: [PATCH] first working version --- .gitignore | 5 +++++ bin/hubot | 2 +- package.json | 1 + scripts/agenda.coffee | 8 +------- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 030048b..a0b333f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,10 @@ node_modules +hubot.lua .DS_Store* .hubot_history circolari/ run.sh +run_telegram.sh +*.pub +.telegram/ +telegram.config diff --git a/bin/hubot b/bin/hubot index 5ba73d1..58c09e9 100755 --- a/bin/hubot +++ b/bin/hubot @@ -5,4 +5,4 @@ set -e npm install export PATH="node_modules/.bin:node_modules/hubot/node_modules/.bin:$PATH" -DEBUG=nightmare PYTHON=python2 PORT=9000 BIND_ADDRESS=localhost node_modules/.bin/hubot --name "asjon" "$@" +DEBUG=nightmare PYTHON=python2 BIND_ADDRESS=localhost node_modules/.bin/hubot --name "asjon" "$@" diff --git a/package.json b/package.json index 111b956..c497dc5 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "hubot-rules": "^0.1.0", "hubot-scripts": "^2.5.16", "hubot-shipit": "^0.2.0", + "hubot-tg": "zenitram/hubot-tg", "hubot-youtube": "^0.1.2", "moment": "^2.10.2", "nightmare": "^1.8.0", diff --git a/scripts/agenda.coffee b/scripts/agenda.coffee index 7cba25c..afcafd1 100644 --- a/scripts/agenda.coffee +++ b/scripts/agenda.coffee @@ -11,12 +11,6 @@ downloadAgenda = (day, cb) -> unless b cbCalled = yes cb [] - console.log Nightmare - ### - .exists('a[href="?d='+day+'"]',dayHasEvents) - .click('a[href="/agenda/"]').wait() - .click('a[href="?d='+day+'"]').wait() - ### n = new Nightmare() .goto('https://galilei-cr-sito.registroelettronico.com/login/') .type('#username',process.env.REGISTRO_USERNAME) @@ -32,7 +26,7 @@ downloadAgenda = (day, cb) -> rowExtractor = -> if $('td',this).get(1)? $($('td',this).get(1)).text().trim() - else "" + else "(niente)" $ = cheerio.load htmlData tab = $('.result_table tr').map(rowExtractor).get() tab.splice 0, 2