Skip to content

Commit

Permalink
add area choose
Browse files Browse the repository at this point in the history
  • Loading branch information
Binux committed Sep 15, 2013
1 parent 9d99408 commit 2210456
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions bot.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<form id=login_form onsubmit="return login(this);">
login_id: <input name=id />
password: <input type=password name=pwd />
area_id: <input name=area />
<input id=submit type=submit value=login />
</form>
</section>
Expand Down
3 changes: 2 additions & 1 deletion web_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,13 @@ def websocket_app(environ, start_response):
ws = environ["wsgi.websocket"]
login_id = request.GET['id']
password = request.GET['password']
area = request.GET['area']
bot = WebSocketBot(ws)
print "conn+%s=%d %s" % (environ.get('HTTP_X_REAL_IP', environ['REMOTE_ADDR']),
WebSocketBot.connected, environ.get('HTTP_USER_AGENT', '-'))
while True:
try:
bot.run(login_id, password)
bot.run(login_id, password, area)
except ma.HeaderError, e:
print e.code, e.message
ws.send('%s %s %s' % (e.code, e.message, 'sleep for 10min'))
Expand Down

0 comments on commit 2210456

Please sign in to comment.