Find the key app key and app secret in the basic information of your application. Second, fill in the authorization callback page and cancel the callback page URL in the application's advanced information, this can be your local web application URL or a valid URL on the Network (can be a http://www.baidu.com), note that this URL cannot end/
All these materials are required
To begin.
Download the package and import it to your editing tool (eclipse or myeclipse)
Edit the config. properties file and enter client_id = app key client_sercret = app_secret redirect_uri = the authorization callback URL you just entered in the application's advanced information. After filling in the information, OK to save.
Then run weibo4j under examples. examples. oauth4code class under the oau2package. Now you will see http: // *******/in the URL of your callback page ://********/? Code = *******************************, the address information before the code is the URL of the callback you fill in, and the subsequent code is the key. You can check the console information again, that is, wait for you to enter the code value. You only need to paste the code value to the console and press enter to display a lot of information about your Weibo. Write down the value of access_token in the last line. With the value of this access_token, you can do everything you want, including publishing Sina Weibo.
Let's look back at the updatestatus class under weibo4j. Examples. Timeline under the example package.
String access_token = "2.001gkuccdjzabebcc4a40cc36fj6lb"; string statuses = "as long as one access_token, you can play Sina Weibo, oyea ~~ "; Weibo = new Weibo (); Weibo. settoken (access_token); timeline TM = new timeline (); try {status = TM. updatestatus (statuses); log. loginfo (status. tostring ();} catch (weiboexception e) {e. printstacktrace ();}}
Take a look and see if your Sina Weibo has published this message ~~~~~ ·