Permalink
Browse files

Bugfixes to address XML formatting

Repo version throws a fatal error as of March 2013. Needs array indices to get correct data from XML/DOM.
  • Loading branch information...
1 parent ea0496b commit f5fbd93d21980938d724552a579926ff810cb10a @cmckendry cmckendry committed Mar 28, 2013
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/scripts/mta.coffee
View
@@ -30,12 +30,12 @@ mtaMe = (msg) ->
throw err
re = new RegExp(msg.match[1], 'gi')
if msg.match[1].length is 1 or msg.match[1].toUpperCase() is 'SIR'
- for k in res.service.subway.line
- str = k.name
+ for k in res.service.subway[0].line
+ str = k.name[0]
if str.match(re)
- if k.status == 'GOOD SERVICE'
+ if k.status[0] == 'GOOD SERVICE'
msg.send 'the ' + str + ' train is ok!'
- else if k.status == 'PLANNED WORK'
+ else if k.status[0] == 'PLANNED WORK'
msg.send 'heads up, the ' + str + ' train has planned work.'
else
msg.send 'the ' + str + ' train is all kinds of messed up'

0 comments on commit f5fbd93

Please sign in to comment.