def get_custom_menu(): return False; access_token = get_access_token() url = WEIXIN_URLS['get_custom_menu'](access_token) res = http_get(url) rjson = json.loads(res) return rjson.get('menu', {}).get('button', [])
def get_access_token(): url = WEIXIN_URLS['access_token']() res = http_get(url) rjson = json.loads(res) if 'errorcode' in rjson: raise res return rjson['access_token']
def get_custom_menu(): return False access_token = get_access_token() url = WEIXIN_URLS['get_custom_menu'](access_token) res = http_get(url) rjson = json.loads(res) return rjson.get('menu', {}).get('button', [])
def wechat_wall(request): code = request.GET.get('code') url = WEIXIN_URLS['get_openid'](code) res = http_get(url) rtn_json = json.loads(res) openid = rtn_json['openid'] return redirect('http://wx1.igeek.asia/u/loading/' + openid)
def loading(request): code = request.GET.get('code') url = WEIXIN_URLS['get_openid'](code) res = http_get(url) rtn_json = json.loads(res) openid = rtn_json['openid'] if select_users_by_openid(openid).exists(): return redirect(s_reverse_wall(openid)) else: return redirect(s_reverse_login(openid))
def uc_center(request): code = request.GET.get('code') url = WEIXIN_URLS['get_openid'](code) res = http_get(url) rtn_json = json.loads(res) openid = rtn_json['openid'] if select_users_by_openid(openid).exists(): return redirect(s_reverse_uc_ticket(openid)) else: return redirect(s_reverse_uc_account(openid))
def get_user_vote(openid): return http_get('http://166.111.80.30/acquireid?openid='+openid)
def get_user_vote(openid): return http_get('http://166.111.80.30/acquireid?openid=' + openid)