PHP获取新浪微博token

最近在做采集微博的功能,由于要自动采集,所以必须获得最终的用户的token,获取了这个token以后就可以为所欲为啦! 贴代码 $s = new SaeTOAuthV2 ( WB_AKEY, WB_SKEY); //准备post数据 $post ['action'] = 'login'; //$post ['display'] = 'default'; //$post ['withOfficalFlag'] = 0; //$post ['quick_auth'] = null; //$post ['withOfficalAccount'] = ''; //$post ['scope'] = ''; //$post ['ticket'] = ''; //$post ['isLoginSina'] = ''; //$post ['isLoginSina'] = 'code'; //regCallback|appkey62需要预先请求一次拿到 //$post ['regCallback'] = $match_regCallback[1]; //这里不用urlencode,http_build_query会自动处理 $post ['redirect_uri'] = WB_CALLBACK_URL; $post ['client_id'] = WB_AKEY; //$post ['appkey62'] = $match_appkey[1]; //$post ['state'] = ''; //$post ['verifyToken'] = null; //$post ['from'] = ''; $post ['userId'] = '*******';//测试用户名 $post ['passwd'] = '*******';//测试密码,不要有!@¥%……&*()这些符号,最好全是字符或数字,否则验证会失败 $post = http_build_query($post); //UA貌似没有也行,保险起见还是加上吧 $UA = 'Mozilla/5....

May 15, 2014 · 1 min · Me