| 535 | return 'unknown' |
| 536 | |
| 537 | def run(self): |
| 538 | self.get_uuid() |
| 539 | self.gen_qr_code('qr.png') |
| 540 | print '[INFO] Please use WeCaht to scan the QR code .' |
| 541 | self.wait4login(1) |
| 542 | print '[INFO] Please confirm to login .' |
| 543 | self.wait4login(0) |
| 544 | if self.login(): |
| 545 | print '[INFO] Web WeChat login succeed .' |
| 546 | else: |
| 547 | print '[ERROR] Web WeChat login failed .' |
| 548 | return |
| 549 | if self.init(): |
| 550 | print '[INFO] Web WeChat init succeed .' |
| 551 | else: |
| 552 | print '[INFO] Web WeChat init failed' |
| 553 | return |
| 554 | self.status_notify() |
| 555 | self.get_contact() |
| 556 | print '[INFO] Get %d contacts' % len(self.contact_list) |
| 557 | print '[INFO] Start to process messages .' |
| 558 | self.proc_msg() |
| 559 | |
| 560 | def get_uuid(self): |
| 561 | url = 'https://login.weixin.qq.com/jslogin' |