def register_monkey(self): print '------------ register_monkey ------------' groupList = [{'groupId': key, 'groupName': value['groupName']} for key, value in self.groupList.iteritems()] data = { 'cmd': 'register', 'qq': self.qq['qqId'], 'qqName': self.qq['qqName'], 'url':self.qq['url'], 'groupList': json.dumps(groupList) } url_post(self.qq['robot_url'], data) return 0
def heartbeat_monkey(self): print '------------ heartbeat_monkey ------------' self.touchByMonkeyPixel(self.emulator['heartbeat']) groupList = [{'groupId': key, 'groupName': value['groupName']} for key, value in self.groupList.iteritems()] data = { 'cmd': 'heartbeat', 'qq': self.qq['qqId'], 'qqName': self.qq['qqName'], 'url':self.qq['url'], 'groupList': json.dumps(groupList) } url_post(self.qq['robot_url'], data) return 0