Skip to content

Commit

Permalink
change sync url
Browse files Browse the repository at this point in the history
  • Loading branch information
liuwangsheng01 committed Oct 12, 2016
1 parent d358ce0 commit 5172afe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ def handle_msg_all(self, msg):
self.send_msg_by_uid(u'hi', msg['user']['id'])
self.send_img_msg_by_uid("img/1.png", msg['user']['id'])
self.send_file_msg_by_uid("img/1.png", msg['user']['id'])
'''

def schedule(self):
self.send_msg(u'测试群', u'测试')
'''
self.send_img_msg_by_uid("img/1.png", self.get_user_id(u"测试群"))
self.send_file_msg_by_uid("img/1.png", self.get_user_id(u"测试群"))
time.sleep(5)


def main():
Expand Down
4 changes: 2 additions & 2 deletions wxbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ def status_notify(self):
return dic['BaseResponse']['Ret'] == 0

def test_sync_check(self):
for host in ['webpush', 'webpush2']:
for host in ['webpush.wx', 'webpush2.wx', 'webpush.weixin', 'webpush2.weixin2', ]:
self.sync_host = host
retcode = self.sync_check()[0]
if retcode == '0':
Expand All @@ -1244,7 +1244,7 @@ def sync_check(self):
'synckey': self.sync_key_str,
'_': int(time.time()),
}
url = 'https://' + self.sync_host + '.wx.qq.com/cgi-bin/mmwebwx-bin/synccheck?' + urllib.urlencode(params)
url = 'https://' + self.sync_host + '.qq.com/cgi-bin/mmwebwx-bin/synccheck?' + urllib.urlencode(params)
try:
r = self.session.get(url, timeout=60)
r.encoding = 'utf-8'
Expand Down

0 comments on commit 5172afe

Please sign in to comment.