Before logging on to Weibo, you need to apply for the APPKEY and AppSecret. to apply for this method, go to open.weibo.com to apply for relevant content. Relevant development documents are also available on the official website. weibo .... before logging on to Weibo, you need to apply for the app key and App Secret. to apply for this method, go to open.weibo.com to apply for relevant content.
Relevant development documents are also available on the official website at http://open.weibo.com/wiki.
The php sdk I downloaded here is directly used for web site applications.
Download the SDK and configure the config file.
* The callback address here refers to the page jump to YOUR_REGISTERED_REDIRECT_URI /? Code = CODE // YOUR_REGISTERED_REDIRECT_URI is your callback address.
The first step is to guide the user to authorize.
GetAuthorizeURL (http: // pic3.phprm.com/2014/05/09/CANVAS_PAGE.jpg); echo "authorize";?> // Authorization address: https://api.weibo.com/oauth2/authorize?
Client_id = YOUR_CLIENT_ID & response_type = code & redirect_uri = YOUR_REGISTERED_REDIRECT_URI
If you agree to the authorization, you need to obtain the Access Token in your callback address to call the interface. Obtain information, and so on...
getAccessToken('code', $keys); var_dump($bb); }?>
After obtaining the AccessToken, you can call all encapsulated functions of saetv2.ex. class. php to perform operations. for example, if I log on to the SDK, I need to obtain the user information:
Corresponding API: users/show ** @ access public * @ param mixed $ uid_or_name UID or Weibo nickname. * @ Return array */function show_user ($ uid_or_name) {return $ this-> request_with_uid ('https: // api.t.sina.com.cn/users/show.json', $ uid_or_name);}?>