From 4814a8e27e1f7178e370b8ed1e40f29a4f83331d Mon Sep 17 00:00:00 2001 From: urinx <1336006643@qq.com> Date: Fri, 5 Feb 2016 19:03:43 +0800 Subject: [PATCH] receive position message --- weixin.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/weixin.py b/weixin.py index f263328..839d554 100755 --- a/weixin.py +++ b/weixin.py @@ -298,8 +298,13 @@ class WebWeixin(object): if msgType == 51: print '[*] 成功截获微信初始化消息' elif msgType == 1: - if msg['ToUserName'] == 'filehelper': - print name+' -> 文件传输助手: '+content.replace('
','\n') + if content.find('http://weixin.qq.com/cgi-bin/redirectforward?args=') != -1: + # 地理位置消息 + data = self._get(content).decode('gbk').encode('utf-8') + pos = self._searchContent('title', data, 'xml') + print '%s 给你发送了一个位置消息 [我在%s]' % (name, pos) + elif msg['ToUserName'] == 'filehelper': + print '%s -> 文件传输助手: %s' % (name, content.replace('
','\n')) elif msg['FromUserName'] == self.User['UserName']: pass elif msg['ToUserName'][:2] == '@@':