first working version
This commit is contained in:
parent
4441ab8735
commit
35517b4e3a
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,5 +1,10 @@
|
|||||||
node_modules
|
node_modules
|
||||||
|
hubot.lua
|
||||||
.DS_Store*
|
.DS_Store*
|
||||||
.hubot_history
|
.hubot_history
|
||||||
circolari/
|
circolari/
|
||||||
run.sh
|
run.sh
|
||||||
|
run_telegram.sh
|
||||||
|
*.pub
|
||||||
|
.telegram/
|
||||||
|
telegram.config
|
||||||
|
@ -5,4 +5,4 @@ set -e
|
|||||||
npm install
|
npm install
|
||||||
export PATH="node_modules/.bin:node_modules/hubot/node_modules/.bin:$PATH"
|
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" "$@"
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
"hubot-rules": "^0.1.0",
|
"hubot-rules": "^0.1.0",
|
||||||
"hubot-scripts": "^2.5.16",
|
"hubot-scripts": "^2.5.16",
|
||||||
"hubot-shipit": "^0.2.0",
|
"hubot-shipit": "^0.2.0",
|
||||||
|
"hubot-tg": "zenitram/hubot-tg",
|
||||||
"hubot-youtube": "^0.1.2",
|
"hubot-youtube": "^0.1.2",
|
||||||
"moment": "^2.10.2",
|
"moment": "^2.10.2",
|
||||||
"nightmare": "^1.8.0",
|
"nightmare": "^1.8.0",
|
||||||
|
@ -11,12 +11,6 @@ downloadAgenda = (day, cb) ->
|
|||||||
unless b
|
unless b
|
||||||
cbCalled = yes
|
cbCalled = yes
|
||||||
cb []
|
cb []
|
||||||
console.log Nightmare
|
|
||||||
###
|
|
||||||
.exists('a[href="?d='+day+'"]',dayHasEvents)
|
|
||||||
.click('a[href="/agenda/"]').wait()
|
|
||||||
.click('a[href="?d='+day+'"]').wait()
|
|
||||||
###
|
|
||||||
n = new Nightmare()
|
n = new Nightmare()
|
||||||
.goto('https://galilei-cr-sito.registroelettronico.com/login/')
|
.goto('https://galilei-cr-sito.registroelettronico.com/login/')
|
||||||
.type('#username',process.env.REGISTRO_USERNAME)
|
.type('#username',process.env.REGISTRO_USERNAME)
|
||||||
@ -32,7 +26,7 @@ downloadAgenda = (day, cb) ->
|
|||||||
rowExtractor = ->
|
rowExtractor = ->
|
||||||
if $('td',this).get(1)?
|
if $('td',this).get(1)?
|
||||||
$($('td',this).get(1)).text().trim()
|
$($('td',this).get(1)).text().trim()
|
||||||
else ""
|
else "(niente)"
|
||||||
$ = cheerio.load htmlData
|
$ = cheerio.load htmlData
|
||||||
tab = $('.result_table tr').map(rowExtractor).get()
|
tab = $('.result_table tr').map(rowExtractor).get()
|
||||||
tab.splice 0, 2
|
tab.splice 0, 2
|
||||||
|
Loading…
Reference in New Issue
Block a user